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 <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2020-12-21 16:34:32 +01:00
parent 2e6c131487
commit 3b364c6509
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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");