]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Do not support 'serial' scsi-block 'lun' devices
authorJohn Ferlan <jferlan@redhat.com>
Tue, 9 Jun 2015 20:49:00 +0000 (16:49 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 15 Jun 2015 11:30:29 +0000 (07:30 -0400)
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.

docs/formatdomain.html.in
src/qemu/qemu_command.c

index b8af1d01331c3f68730abd607ea61aa7f97221e1..3ccc71c55918670e01c4b6c5b21071f41b2de55e 100644 (file)
       <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>
index 89f775de534cb2753d3259ba33a7c431663b1315..1351cba42e894e6d34c22aa7177fbd19abd01832 100644 (file)
@@ -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);
     }