All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Introduce dom0-min-space configuration option
@ 2010-07-12 18:07 Michal Novotny
  2010-07-13 18:02 ` Ian Jackson
  0 siblings, 1 reply; 17+ messages in thread
From: Michal Novotny @ 2010-07-12 18:07 UTC (permalink / raw)
  To: 'xen-devel@lists.xensource.com'

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

Hi,
This is the patch to introduce configuration option called
dom0-min-space since there were some issues with data inflation
because of invalid input data stream for zlib decompression.
The issue occured because of insufficient free space on the dom0 so
this patch checks the free available space for /var/lib/xen
and refuses to start up any guests when the space is below
specified value. Setting up the value to 0 disables the check
which preserves the behaviour before this patch applied and
this is the default value for this option.

Michal

Signed-off-by: Michal Novotny <minovotn@redhat.com>

-- 
Michal Novotny<minovotn@redhat.com>, RHCE
Virtualization Team (xen userspace), Red Hat


[-- Attachment #2: xen-introduce-dom0-min-space.patch --]
[-- Type: text/x-patch, Size: 2368 bytes --]

diff -r 9f08c4e82037 tools/examples/xend-config.sxp
--- a/tools/examples/xend-config.sxp	Mon Jul 12 18:39:18 2010 +0100
+++ b/tools/examples/xend-config.sxp	Mon Jul 12 22:05:56 2010 +0200
@@ -205,6 +205,11 @@
 # enable-dom0-ballooning below) and for xm mem-set when applied to dom0.
 (dom0-min-mem 196)
 
+# Dom0 will need at least specified amount of free space for
+# /var/lib/xen otherwise it will refuse to start up any new
+# guests. Value is in MB and setting it to 0 disables the check.
+(dom0-min-space 0)
+
 # Whether to enable auto-ballooning of dom0 to allow domUs to be created.
 # If enable-dom0-ballooning = no, dom0 will never balloon out.
 (enable-dom0-ballooning yes)
diff -r 9f08c4e82037 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Mon Jul 12 18:39:18 2010 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py	Mon Jul 12 22:05:56 2010 +0200
@@ -2837,6 +2837,16 @@
 
         self._configureBootloader()
 
+        # Check whether dom0 does have enough free space to create the guest
+        stat = os.statvfs("/var/lib/xen")
+        free = int((stat.f_bsize * stat.f_bavail) / 1048576)
+        log.debug("Free space for Xen files on dom0: %s MiB" % free)
+        dom0_min_space = xoptions.instance().get_dom0_min_space()
+        if dom0_min_space > 0 and free < dom0_min_space:
+            raise XendError('Dom0 requires at least %s MiBs free space for '
+                            '/var/lib/xen but only %s MiBs is available.' %
+                            (dom0_min_space, free))
+
         try:
             self.image = image.create(self, self.info)
 
diff -r 9f08c4e82037 tools/python/xen/xend/XendOptions.py
--- a/tools/python/xen/xend/XendOptions.py	Mon Jul 12 18:39:18 2010 +0100
+++ b/tools/python/xen/xend/XendOptions.py	Mon Jul 12 22:05:56 2010 +0200
@@ -105,6 +105,8 @@
 
     dom0_min_mem_default = 0
 
+    dom0_min_space_default = 0
+
     reserved_memory_default = 0
 
     dom0_vcpus_default = 0
@@ -359,6 +361,9 @@
     def get_dom0_min_mem(self):
         return self.get_config_int('dom0-min-mem', self.dom0_min_mem_default)
 
+    def get_dom0_min_space(self):
+        return self.get_config_int('dom0-min-space', self.dom0_min_space_default)
+
     def get_enable_dom0_ballooning(self):
         enable_dom0_ballooning_default = 'yes'
         if self.get_dom0_min_mem() == 0:

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-07-26 12:48 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-12 18:07 [PATCH] Introduce dom0-min-space configuration option Michal Novotny
2010-07-13 18:02 ` Ian Jackson
2010-07-14 11:23   ` Michal Novotny
2010-07-21  3:52     ` Michal Novotny
2010-07-21 13:25     ` Ian Jackson
2010-07-22  7:50       ` Michal Novotny
2010-07-22  7:52         ` Michal Novotny
2010-07-23 16:00         ` Ian Jackson
2010-07-26  6:55           ` Michal Novotny
2010-07-26  9:59             ` Paolo Bonzini
2010-07-26 10:36               ` Michal Novotny
2010-07-26 11:18                 ` Paolo Bonzini
2010-07-26 11:21                   ` Michal Novotny
2010-07-26 11:31                     ` Paolo Bonzini
2010-07-26 11:48                       ` Michal Novotny
2010-07-26 12:23                         ` Paolo Bonzini
2010-07-26 12:48                           ` Michal Novotny

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.