[PATCH v3 3/4] vz: refactoring of prlsdkCreateCt

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

 



We do not need to check domainf fs type there,
because it is done in prlsdkCheckUnsupportedParams.

Signed-off-by: Olga Krishtal <okrishtal@xxxxxxxxxxxxx>
---
 src/vz/vz_sdk.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index b13b84d..5d4f76a 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3861,23 +3861,20 @@ prlsdkCreateCt(vzDriverPtr driver, virDomainDefPtr def)
     int useTemplate = 0;
     size_t i;
 
-    if (def->nfss > 1) {
-        /* Check all filesystems */
-        for (i = 0; i < def->nfss; i++) {
-            if (def->fss[i]->type != VIR_DOMAIN_FS_TYPE_FILE) {
-                virReportError(VIR_ERR_INVALID_ARG, "%s",
-                               _("Unsupported filesystem type."));
-                return -1;
-            }
-        }
-    } else if (def->nfss == 1) {
-        if (def->fss[0]->type == VIR_DOMAIN_FS_TYPE_TEMPLATE) {
-            useTemplate = 1;
-        } else if (def->fss[0]->type != VIR_DOMAIN_FS_TYPE_FILE) {
+    for (i = 0; i < def->nfss; i++) {
+        if (useTemplate) {
             virReportError(VIR_ERR_INVALID_ARG, "%s",
-                           _("Unsupported filesystem type."));
+                           _("Unsupported configuration"));
             return -1;
         }
+        if (def->fss[i]->type == VIR_DOMAIN_FS_TYPE_TEMPLATE)
+            useTemplate = 1;
+    }
+
+    if (useTemplate && def->nfss > 1) {
+        virReportError(VIR_ERR_INVALID_ARG, "%s",
+                       _("Unsupported configuration"));
+        return -1;
     }
 
     confParam.nVmType = PVT_CT;
-- 
1.8.3.1

--
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]