[PATCH] qemu: Do not support 'serial' scsi-block 'lun' devices

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=1021480

Seems the property has been deprecated for qemu, although seemingly ignored.

This patch enforces from a libvirt perspective that a scsi-block 'lun'
device should not provide the 'serial' property.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 docs/formatdomain.html.in | 3 +++
 src/qemu/qemu_command.c   | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 1781996..4eb907d 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2502,6 +2502,9 @@
       <dd>If present, this specify serial number of virtual hard drive.
           For example, it may look
           like <code>&lt;serial&gt;WD-WMAP9A966149&lt;/serial&gt;</code>.
+          Not supported for scsi-block devices, that is those using
+          disk <code>type</code> 'block' using <code>device</code> 'lun'
+          on <code>bus</code> 'scsi'.
           <span class="since">Since 0.7.1</span>
       </dd>
       <dt><code>wwn</code></dt>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0a6d92f..cbea0d5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3731,6 +3731,13 @@ qemuBuildDriveStr(virConnectPtr conn,
         virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_SERIAL)) {
         if (qemuSafeSerialParamValue(disk->serial) < 0)
             goto error;
+        if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI &&
+            disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("scsi-block 'lun' devices do not support the "
+                             "serial property"));
+            goto error;
+        }
         virBufferAddLit(&opt, ",serial=");
         virBufferEscape(&opt, '\\', " ", "%s", disk->serial);
     }
-- 
2.1.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]