On 03.06.2012 22:55, Guido Günther wrote:
with persist=false the domain config file will not be updated.
---
src/openvz/openvz_driver.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index fb72cde..02a0133 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -191,7 +191,8 @@ cleanup:
static int
openvzSetDiskQuota(virDomainDefPtr vmdef,
- virDomainFSDefPtr fss)
+ virDomainFSDefPtr fss,
+ bool persist)
{
int ret = -1;
unsigned long long sl, hl;
@@ -199,8 +200,9 @@ openvzSetDiskQuota(virDomainDefPtr vmdef,
"--quiet",
"set",
vmdef->name,
- "--save",
NULL);
+ if (persist)
+ virCommandAddArg(cmd, "--save");
if (fss->type == VIR_DOMAIN_FS_TYPE_TEMPLATE) {
if (fss->space_hard_limit) {
@@ -938,7 +940,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
}
if (vm->def->nfss == 1) {
- if (openvzSetDiskQuota(vm->def, vm->def->fss[0]) < 0) {
+ if (openvzSetDiskQuota(vm->def, vm->def->fss[0], true) < 0) {
openvzError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not set disk quota"));
goto cleanup;
@@ -1026,7 +1028,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
}
if (vm->def->nfss == 1) {
- if (openvzSetDiskQuota(vm->def, vm->def->fss[0]) < 0) {
+ if (openvzSetDiskQuota(vm->def, vm->def->fss[0], true) < 0) {
openvzError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not set disk quota"));
goto cleanup;
ACK
Michal