]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vmx: Treat missing cdrom-image as empty drive
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 21 Dec 2020 15:34:32 +0000 (16:34 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 6 Jan 2021 01:05:10 +0000 (02:05 +0100)
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>
src/vmx/vmx.c
tests/vmx2xmltest.c

index aa5d1d4eedea1949bc77fa7ff136888eafb279f5..56318fc8b2852e070094ae2b029616c9b154b52d 100644 (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);
index d622e46fd5631c24739f4c50d2b178919949b0fc..11739e6f3f51e96b61ba5378c76d58361b39d264 100644 (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");