]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: Move disk serial validation to qemuCheckDiskConfig
authorPeter Krempa <pkrempa@redhat.com>
Wed, 1 Nov 2017 15:05:55 +0000 (16:05 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 7 Nov 2017 13:38:11 +0000 (14:38 +0100)
src/qemu/qemu_command.c

index 1c8e3d6838f72bb20348aea5ebcbe8a9bed7dd41..2fe4ae380a051092d278c1e4286dc17f21152948 100644 (file)
@@ -1429,6 +1429,10 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk,
         }
     }
 
+    if (disk->serial &&
+        qemuSafeSerialParamValue(disk->serial) < 0)
+        return -1;
+
     return 0;
 }
 
@@ -1714,8 +1718,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);
     }