[PATCH 5/6] vz: fix template ct creation

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

 



From: Mikhail Feoktistov <mfeoktistov@xxxxxxxxxxxxx>

First we don't need to add disk in this case. Second flag should
be skipped.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 src/vz/vz_sdk.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index e487f26..b595fe7 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3435,6 +3435,9 @@ prlsdkAddFS(PRL_HANDLE sdkdom, virDomainFSDefPtr fs)
     PRL_HANDLE sdkdisk = PRL_INVALID_HANDLE;
     int ret = -1;
 
+    if (fs->type == VIR_DOMAIN_FS_TYPE_TEMPLATE)
+        return 0;
+
     if (prlsdkCheckFSUnsupportedParams(fs) < 0)
         return -1;
 
@@ -3733,6 +3736,7 @@ prlsdkCreateCt(vzDriverPtr driver, virDomainDefPtr def)
     PRL_HANDLE job = PRL_INVALID_HANDLE;
     PRL_HANDLE result = PRL_INVALID_HANDLE;
     PRL_RESULT pret;
+    PRL_UINT32 flags;
     int ret = -1;
     int useTemplate = 0;
     size_t i;
@@ -3777,8 +3781,10 @@ prlsdkCreateCt(vzDriverPtr driver, virDomainDefPtr def)
     if (ret)
         goto cleanup;
 
-    job = PrlVm_RegEx(sdkdom, "",
-                      PACF_NON_INTERACTIVE_MODE | PRNVM_PRESERVE_DISK);
+    flags = PACF_NON_INTERACTIVE_MODE;
+    if (!useTemplate)
+        flags |= PRNVM_PRESERVE_DISK;
+    job = PrlVm_RegEx(sdkdom, "", flags);
     if (PRL_FAILED(waitJob(job)))
         ret = -1;
 
-- 
2.4.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]