[PATCH 2/3] openvz: add persist parameter to openvzSetDiskQuota

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

 



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;
-- 
1.7.10

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