[libvirt PATCH v3 7/8] esx: Handle missing images in esxParseVMXFileName

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/esx/esx_driver.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index dde51688f72f..0271f81a5655 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -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;
         }
 
-- 
2.30.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux