Skip to contentSkip to conversation

boot with default on dom0_mem allocation failure.

PATCH New INAKOSHI Hiroya 1 participant 1 message Aug 31, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boot with default on dom0_mem allocation failure.

Hi,

this patch makes Xen boot with the default dom0_mem value when the given value exceeds available memory, instead Xen panics and reboots.

Administrators have a chance to correct dom0_mem (and other parameters if necessary) after Xen is up with default, seeing the warning message.

Tested by booting Domain-0.

xen/arch/x86/domain_build.c +6 -0
diff -r f790546ecfda xen/arch/x86/domain_build.c
@@ -267,6 +267,12 @@ int construct_dom0(struct domain *d,
     printk("*** LOADING DOMAIN 0 ***\n");
 
     d->max_pages = ~0U;
+
+    if ( dom0_nrpages > (avail_domheap_pages() + initial_images_nrpages()) )
+    {
+        printk("Warning: dom0_mem exceed available memory. Booting with default.\n");
+        dom0_nrpages = 0;
+    }
 
     /*
      * If domain 0 allocation isn't specified, reserve 1/16th of available

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel