]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: process: Reorder operations on early VM startup
authorPeter Krempa <pkrempa@redhat.com>
Thu, 4 Feb 2016 13:48:57 +0000 (14:48 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 8 Feb 2016 08:08:38 +0000 (09:08 +0100)
Retrieval of the driver capabilities as well as emulator capabilities
does not require the complete qemuProcessStop to be executed on
failure.

src/qemu/qemu_process.c

index f82158d5400b9565357c2253e3cb578e2b81ca49..13974ab4657510bffcdf7033dce468da4ea4aa58 100644 (file)
@@ -4432,7 +4432,14 @@ qemuProcessInit(virQEMUDriverPtr driver,
     }
 
     if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
-        goto stop;
+        goto cleanup;
+
+    VIR_DEBUG("Determining emulator version");
+    virObjectUnref(priv->qemuCaps);
+    if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
+                                                      vm->def->emulator,
+                                                      vm->def->os.machine)))
+        goto cleanup;
 
     /* Some things, paths, ... are generated here and we want them to persist.
      * Fill them in prior to setting the domain def as transient. */
@@ -4462,13 +4469,6 @@ qemuProcessInit(virQEMUDriverPtr driver,
                              VIR_HOOK_SUBOP_BEGIN) < 0)
         goto stop;
 
-    VIR_DEBUG("Determining emulator version");
-    virObjectUnref(priv->qemuCaps);
-    if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
-                                                      vm->def->emulator,
-                                                      vm->def->os.machine)))
-        goto stop;
-
     ret = 0;
 
  cleanup: