Since persistent_def is the only place that uses it, let's just keep
it closer to where it's used.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/qemu/qemu_driver.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3ce3f2d..78e917e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17449,15 +17449,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);
@@ -17550,6 +17541,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;
--
2.7.4