qemu: Move setting of conf_disk in qemuDomainSetBlockIoTune

Since persistent_def is the only place that uses it, let's just keep
it closer to where it's used.
This commit is contained in:
John Ferlan 2016-10-06 14:21:29 -04:00
parent 0ac8b70bb3
commit 1f89039ddb

View File

@ -17455,15 +17455,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
goto endjob;
}
if (persistentDef) {
if (!(conf_disk = virDomainDiskByName(persistentDef, path, true))) {
virReportError(VIR_ERR_INVALID_ARG,
_("missing persistent configuration for disk '%s'"),
path);
goto endjob;
}
}
if (def) {
supportMaxOptions = virQEMUCapsGet(priv->qemuCaps,
QEMU_CAPS_DRIVE_IOTUNE_MAX);
@ -17556,6 +17547,12 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
}
if (persistentDef) {
if (!(conf_disk = virDomainDiskByName(persistentDef, path, true))) {
virReportError(VIR_ERR_INVALID_ARG,
_("missing persistent configuration for disk '%s'"),
path);
goto endjob;
}
oldinfo = &conf_disk->blkdeviotune;
if (!set_bytes) {
info.total_bytes_sec = oldinfo->total_bytes_sec;