[PATCH v2 1/4] conf: Set defaultFormat if no storage source XML present

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

 



While parsing if the storage source is not present, then a defaultFormat
was not set. This could lead to oddities such as seeing "unknown" format
in output for the "logical" pool even though the only format the pool could
support would be "lvm2".

This does "put a label" on other pool defaults as follows:

   File System: FS_AUTO
   Network File System: NETFS_AUTO
   Disk: UNKNOWN

Each of which is the "0" value for their respective pools and thus
would be no "real" change.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/storage_conf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 28277e5..585ca71 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -703,6 +703,9 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
         if (virStoragePoolDefParseSource(ctxt, &ret->source, ret->type,
                                          source_node) < 0)
             goto error;
+    } else {
+        if (options->formatFromString)
+            ret->source.format = options->defaultFormat;
     }
 
     ret->name = virXPathString("string(./name)", ctxt);
-- 
2.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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