From: Martin Kletzander Date: Mon, 21 Dec 2020 15:34:32 +0000 (+0100) Subject: vmx: Treat missing cdrom-image as empty drive X-Git-Tag: v7.0.0-rc1~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b364c6509db4ff643bdde3f8c5cd620304e64b4;p=thirdparty%2Flibvirt.git vmx: Treat missing cdrom-image as empty drive This is perfectly valid in VMWare and the VM just boots with an empty drive. We used to just skip the whole drive before, but since we changed how we parse empty cdrom drives this results in an error. Make it behave more closer to VMWare. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1903953 Signed-off-by: Martin Kletzander --- diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index aa5d1d4eed..56318fc8b2 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2448,7 +2448,7 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con } virDomainDiskSetType(*def, VIR_STORAGE_TYPE_FILE); - if (ctx->parseFileName(fileName, ctx->opaque, &tmp, false) < 0) + if (ctx->parseFileName(fileName, ctx->opaque, &tmp, true) < 0) goto cleanup; virDomainDiskSetSource(*def, tmp); VIR_FREE(tmp); diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index d622e46fd5..11739e6f3f 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -247,8 +247,8 @@ mymain(void) DO_TEST("cdrom-ide-raw-auto-detect", "cdrom-ide-raw-auto-detect"); DO_TEST("cdrom-ide-raw-auto-detect", "cdrom-ide-raw-auto-detect"); - DO_TEST_FAIL("cdrom-ide-file-missing-datastore", "cdrom-ide-empty"); - DO_TEST_FAIL("cdrom-ide-file-missing-file", "cdrom-ide-empty"); + DO_TEST("cdrom-ide-file-missing-datastore", "cdrom-ide-empty"); + DO_TEST("cdrom-ide-file-missing-file", "cdrom-ide-empty"); DO_TEST_FAIL("harddisk-ide-file-missing-datastore", "harddisk-ide-file"); DO_TEST_FAIL("harddisk-scsi-file-missing-file", "harddisk-scsi-file");