]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Avoid dangling job in qemuDomainSetBlockIoTune
authorJiri Denemark <jdenemar@redhat.com>
Wed, 18 Sep 2013 08:37:48 +0000 (10:37 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 18 Sep 2013 08:37:48 +0000 (10:37 +0200)
virDomainSetBlockIoTuneEnsureACL was incorrectly called after we already
started a job. As a result of this, the job was not cleaned up when an
access driver had forbidden the action.

src/qemu/qemu_driver.c

index 0763f9b6d51b4ea775b6b53f71328a35293027dd..8a302d1ddcca92d495910e7e35d14b43651d9ed4 100644 (file)
@@ -14673,15 +14673,15 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
     if (!(vm = qemuDomObjFromDomain(dom)))
         return -1;
 
+    if (virDomainSetBlockIoTuneEnsureACL(dom->conn, vm->def, flags) < 0)
+        goto cleanup;
+
     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
         goto cleanup;
 
     priv = vm->privateData;
     cfg = virQEMUDriverGetConfig(driver);
 
-    if (virDomainSetBlockIoTuneEnsureACL(dom->conn, vm->def, flags) < 0)
-        goto cleanup;
-
     if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
         goto endjob;