[XEN] Clamp dom0 memory and CPUs to fit in available resources.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kfraser@localhost.localdomain committed 2006-10-18 17:45:19 +01:00
1 parent 761d4da84e
commit 044aeaa616
1 file changed
+4 -1
+4 -1
View File
@@ -286,7 +286,8 @@ int construct_dom0(struct domain *d,
nr_pages = avail_domheap_pages() + initial_images_nrpages() +
dom0_nrpages;
else
nr_pages = dom0_nrpages;
nr_pages = min(avail_domheap_pages() + initial_images_nrpages(),
(unsigned long)dom0_nrpages);
if ( (rc = parseelfimage(&dsi)) != 0 )
return rc;
@@ -668,6 +669,8 @@ int construct_dom0(struct domain *d,
if ( opt_dom0_max_vcpus == 0 )
opt_dom0_max_vcpus = num_online_cpus();
if ( opt_dom0_max_vcpus > num_online_cpus() )
opt_dom0_max_vcpus = num_online_cpus();
if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
opt_dom0_max_vcpus = MAX_VIRT_CPUS;
printk("Dom0 has maximum %u VCPUs\n", opt_dom0_max_vcpus);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.