From: Michal Privoznik Date: Fri, 15 Dec 2023 13:12:42 +0000 (+0100) Subject: vmx: Accept empty fileName for cdrom-image X-Git-Tag: v10.1.0-rc1~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=555b9c58276a753d0c81e36109d7f426f7f5ff06;p=thirdparty%2Flibvirt.git vmx: Accept empty fileName for cdrom-image 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 Reviewed-by: Ján Tomko --- diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 4ac2320251..1ccf1eee75 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2484,7 +2484,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'"),