qemu: Fix job usage in virDomainGetBlockIoTune

CVE-2013-6458

Every API that is going to begin a job should do that before fetching
data from vm->def.

(cherry picked from commit 3b56425938e2f97208d5918263efa0d6439e4ecd)
This commit is contained in:
Jiri Denemark 2013-12-20 15:41:04 +01:00 committed by Eric Blake
parent 26ff7d4c6e
commit c6fbbe85aa

View File

@ -14773,12 +14773,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
goto cleanup;
}
device = qemuDiskPathToAlias(vm, disk, NULL);
if (!device) {
goto cleanup;
}
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
@ -14786,6 +14780,11 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
&persistentDef) < 0)
goto endjob;
device = qemuDiskPathToAlias(vm, disk, NULL);
if (!device) {
goto endjob;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
priv = vm->privateData;
qemuDomainObjEnterMonitor(driver, vm);