]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Always reset @info in qemuDomainGetJobInfo
authorPeter Krempa <pkrempa@redhat.com>
Fri, 22 Nov 2019 16:39:43 +0000 (17:39 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Dec 2019 14:26:54 +0000 (15:26 +0100)
qemuDomainGetJobInfo didn't always reset the return data in @info.
Thankfully this wouldn't be a problem as the RPC layer does it but we
should do it anyways.

Since we reset the struct we don't have to set the type to
VIR_DOMAIN_JOB_NONE as the value is 0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_driver.c

index 348bddbac45decaf10a1eaabf79a7f59e9cc4026..1911073f3e45481bcd97083439cea93f1f914785 100644 (file)
@@ -13926,6 +13926,8 @@ qemuDomainGetJobInfo(virDomainPtr dom,
     virDomainObjPtr vm;
     int ret = -1;
 
+    memset(info, 0, sizeof(*info));
+
     if (!(vm = qemuDomainObjFromDomain(dom)))
         goto cleanup;
 
@@ -13936,8 +13938,6 @@ qemuDomainGetJobInfo(virDomainPtr dom,
         goto cleanup;
 
     if (jobInfo.status == QEMU_DOMAIN_JOB_STATUS_NONE) {
-        memset(info, 0, sizeof(*info));
-        info->type = VIR_DOMAIN_JOB_NONE;
         ret = 0;
         goto cleanup;
     }