Blob Blame History Raw
From edf9c32b8680db0a4c0037ee2ddd37e29640811e Mon Sep 17 00:00:00 2001
Message-Id: <edf9c32b8680db0a4c0037ee2ddd37e29640811e@dist-git>
From: Doug Goldstein <cardoe@cardoe.com>
Date: Wed, 26 Feb 2014 14:54:08 +0100
Subject: [PATCH] Allow LUN type disks to have no source

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

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.

(cherry picked from commit 3efbe13f4d9a7e92ab3f6f526bc43615c04b132e)

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/conf/domain_conf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7e43232..9456758 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5328,9 +5328,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);
-- 
1.9.0