[libvirt] [PATCH] vmx: Adapt to emptyBackingString for cdrom-image

Michal Privoznik mprivozn at redhat.com
Thu Jan 7 08:59:09 UTC 2016


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

We are missing this value for cdrom-image device. Honestly, I
have no idea whether it can happen for other disk devices too.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/vmx/vmx.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 568b2c7..baf27de 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -2317,6 +2317,16 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
                  */
                 goto ignore;
             }
+        } else if (STREQ(fileName, "emptyBackingString")) {
+            if (deviceType && STRCASENEQ(deviceType, "cdrom-image")) {
+                virReportError(VIR_ERR_INTERNAL_ERROR,
+                               _("Expecting VMX entry '%s' to be 'cdrom-image' "
+                                 "but found '%s'"), deviceType_name, deviceType);
+                goto cleanup;
+            }
+
+            virDomainDiskSetType(*def, VIR_STORAGE_TYPE_FILE);
+            ignore_value(virDomainDiskSetSource(*def, NULL));
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Invalid or not yet handled value '%s' "
-- 
2.4.10




More information about the libvir-list mailing list