From 68d2b7bb402e826812745b67df96f4715746d1bc Mon Sep 17 00:00:00 2001 Message-Id: <68d2b7bb402e826812745b67df96f4715746d1bc.1379597660.git.jdenemar@redhat.com> From: Jiri Denemark Date: Wed, 18 Sep 2013 10:37:48 +0200 Subject: [PATCH] qemu: Avoid dangling job in qemuDomainSetBlockIoTune https://bugzilla.redhat.com/show_bug.cgi?id=700443 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. (cherry picked from commit 13e9bad55ad3d4705585bd483765805973d9f2f1) --- src/qemu/qemu_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 53cb1ec..eb1a2ce 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14945,15 +14945,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; -- 1.8.3.2