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 b589f4e..7937699 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3269,6 +3269,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;
@@ -3504,6 +3507,7 @@ prlsdkCreateCt(virConnectPtr conn, 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;
@@ -3548,8 +3552,10 @@ prlsdkCreateCt(virConnectPtr conn, 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;
--
1.8.3.1