[libvirt] [PATCH v3 libvirt 1/3] conf: add <model> child element to <filesystem>

Giuseppe Scrivano gscrivan at redhat.com
Wed Aug 20 09:21:24 UTC 2014


"Daniel P. Berrange" <berrange at redhat.com> writes:

> From the XML pov, we shouldn't restrict use of <model> to only be
> for FS_TYPE_MOUNT. That is a QEMU driver implementation restriction,
> so just make the QEMU driver raise VIR_ERR_CONFIG_UNSUPPORTED for
> the cases we don't want, when building the CLI args

OK to amend this piece?  The QEMU driver supports only FS_TYPE_MOUNT so
the additional check seems reduntant there.

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 98dbe14..c897f1b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15806,10 +15806,6 @@ virDomainFSDefFormat(virBufferPtr buf,
     case VIR_DOMAIN_FS_TYPE_MOUNT:
         virBufferEscapeString(buf, "<source dir='%s'/>\n",
                               def->src);
-        if (def->model) {
-            virBufferEscapeString(buf, "<model type='%s'/>\n",
-                                  virDomainFSModelTypeToString(def->model));
-        }
         break;
 
     case VIR_DOMAIN_FS_TYPE_BIND:
@@ -15838,6 +15834,11 @@ virDomainFSDefFormat(virBufferPtr buf,
         break;
     }
 
+    if (def->model) {
+        virBufferEscapeString(buf, "<model type='%s'/>\n",
+                              virDomainFSModelTypeToString(def->model));
+    }
+
     virBufferEscapeString(buf, "<target dir='%s'/>\n",
                           def->dst);
 

Thanks,
Giuseppe




More information about the libvir-list mailing list