[PATCH 1/2] domain_conf: add filesystem limits to virDomainFSDef

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

 



---
 src/conf/domain_conf.c |   15 +++++++++++++++
 src/conf/domain_conf.h |    4 ++++
 2 files changed, 19 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 184ff23..2b2a1d9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11101,6 +11101,21 @@ virDomainFSDefFormat(virBufferPtr buf,
     if (virDomainDeviceInfoFormat(buf, &def->info, flags) < 0)
         return -1;
 
+    if (def->hard_limit)
+        virBufferAsprintf(buf, "      <hardlimit>%llu</hardlimit>\n",
+                          def->hard_limit);
+    if (def->soft_limit)
+        virBufferAsprintf(buf, "      <softlimit>%llu</softlimit>\n",
+                          def->soft_limit);
+    if (def->inodes_hard_limit)
+        virBufferAsprintf(buf,
+                          "      <inodes_hardlimit>%llu</inodes_hardlimit>\n",
+                          def->inodes_hard_limit);
+    if (def->inodes_soft_limit)
+        virBufferAsprintf(buf,
+                          "      <inodes_softlimit>%llu</inodes_softlimit>\n",
+                          def->inodes_soft_limit);
+
     virBufferAddLit(buf, "    </filesystem>\n");
 
     return 0;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 5aa8fc1..149607e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -692,6 +692,10 @@ struct _virDomainFSDef {
     char *dst;
     unsigned int readonly : 1;
     virDomainDeviceInfo info;
+    unsigned long long hard_limit; /* in kibibytes */
+    unsigned long long soft_limit; /* in kibibytes */
+    unsigned long long inodes_hard_limit;
+    unsigned long long inodes_soft_limit;
 };
 
 
-- 
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]