Turns out, there are two ways to specify an empty CD-ROM drive in
a .vmx file:
1) .fileName = "emptyBackingString"
2) .fileName = ""
While we do parse 1) successfully, the code does not accept 2)
and an error is reported. Modify the code to treat both cases the
same.
Resolves:
https://issues.redhat.com/browse/RHEL-19380
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/vmx/vmx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 26b89776e1..af1c1640ae 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -2483,7 +2483,8 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOption *xmlopt,
virConf *conf,
*/
goto ignore;
}
- } else if (fileName && STREQ(fileName, "emptyBackingString"))
{
+ } else if (fileName && (STREQ(fileName, "") ||
+ STREQ(fileName, "emptyBackingString"))) {
if (deviceType && STRCASENEQ(deviceType, "cdrom-image")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Expecting VMX entry '%1$s' to be
'cdrom-image' but found '%2$s'"),
--
2.41.0