[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 9/9] qemu: command: Move disk serial validation to checker function



---
 src/qemu/qemu_command.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 507401d3f..1913bbf67 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1428,6 +1428,10 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk,
         }
     }

+    if (disk->serial &&
+        qemuSafeSerialParamValue(disk->serial) < 0)
+        return -1;
+
     return 0;
 }

@@ -1713,8 +1717,6 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,

     if (disk->serial &&
         virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_SERIAL)) {
-        if (qemuSafeSerialParamValue(disk->serial) < 0)
-            goto error;
         virBufferAddLit(&opt, ",serial=");
         virBufferEscape(&opt, '\\', " ", "%s", disk->serial);
     }
-- 
2.14.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]