From: Mikhail Feoktistov <mfeoktistov(a)virtuozzo.com>
First we don't need to add disk in this case. Second flag should
be skipped.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
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