]> xenbits.xensource.com Git - libvirt.git/commitdiff
Allow LUN type disks to have no source
authorDoug Goldstein <cardoe@cardoe.com>
Sun, 8 Sep 2013 18:58:06 +0000 (13:58 -0500)
committerDoug Goldstein <cardoe@cardoe.com>
Mon, 16 Sep 2013 20:21:28 +0000 (15:21 -0500)
CD-ROMs and Floppies are allowed to have no source to imply they are
empty or disconnected. Since the LUN type is used for raw CD-ROM access
with QEMU (and VMWare in the future), it also needs to allow an empty
source when the raw CD-ROM device is disconnected from the domain.

src/conf/domain_conf.c

index 108f0929131456ff4b32ad7023741aa468bf17ea..19bb82e4da0c868748acf2c145a311dca767a2eb 100644 (file)
@@ -5218,9 +5218,11 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
     }
 
     /* Only CDROM and Floppy devices are allowed missing source path
-     * to indicate no media present */
+     * to indicate no media present. LUN is for raw access CD-ROMs
+     * that are not attached to a physical device presently */
     if (source == NULL && hosts == NULL && !def->srcpool &&
         def->device != VIR_DOMAIN_DISK_DEVICE_CDROM &&
+        def->device != VIR_DOMAIN_DISK_DEVICE_LUN &&
         def->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
         virReportError(VIR_ERR_NO_SOURCE,
                        target ? "%s" : NULL, target);