]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: process: Make it obvious that virDomainDefPostParse is called with NULL opaque
authorPeter Krempa <pkrempa@redhat.com>
Sat, 23 Nov 2019 08:43:35 +0000 (09:43 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Dec 2019 14:26:54 +0000 (15:26 +0100)
Commit c90fb5a828a added explicit use of the private copy of the qemu
capabilities to various places. The change to qemuProcessInit was bogus
though as at the point where we re-initiate the post parse callbacks
priv->qemuCaps is still NULL as we clear it after shutdown of the VM and
don't initiate it until a later point.

Using the value from priv->qemuCaps might mislead readers of the code
into thinking that something useful is being passed at that point so go
with an explicit NULL instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c

index a588ee25f8e920fdf97c9c6100e94f2412e2f31b..3083d0b538254471927926bede9546c8a9d5f23a 100644 (file)
@@ -5531,7 +5531,8 @@ qemuProcessInit(virQEMUDriverPtr driver,
     if (vm->def->postParseFailed) {
         VIR_DEBUG("re-running the post parse callback");
 
-        if (virDomainDefPostParse(vm->def, caps, 0, driver->xmlopt, priv->qemuCaps) < 0)
+        /* we don't have the private copy of qemuCaps at this point */
+        if (virDomainDefPostParse(vm->def, caps, 0, driver->xmlopt, NULL) < 0)
             goto cleanup;
     }