]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx: Handle missing images in esxParseVMXFileName
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 5 Jan 2021 12:58:53 +0000 (13:58 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 6 Jan 2021 01:05:10 +0000 (02:05 +0100)
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/esx/esx_driver.c

index dde51688f72f1bf7363b48e9e8b6af6ad60bfb71..0271f81a5655b523d13bcee2c0873208e9867544 100644 (file)
@@ -129,7 +129,7 @@ static int
 esxParseVMXFileName(const char *fileName,
                     void *opaque,
                     char **out,
-                    bool allow_missing G_GNUC_UNUSED)
+                    bool allow_missing)
 {
     esxVMX_Data *data = opaque;
     esxVI_String *propertyNameList = NULL;
@@ -223,9 +223,13 @@ esxParseVMXFileName(const char *fileName,
         }
 
         if (!datastoreList) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("File name '%s' refers to non-existing datastore '%s'"),
-                           fileName, datastoreName);
+            if (allow_missing) {
+                ret = 0;
+            } else {
+                virReportError(VIR_ERR_INTERNAL_ERROR,
+                               _("File name '%s' refers to non-existing datastore '%s'"),
+                               fileName, datastoreName);
+            }
             goto cleanup;
         }