From 8e66050e3223a9aa55ca29ec32b2e78c3e69e085 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 3 Sep 2012 09:40:38 +0200 Subject: make domain_create() return a proper error code While triggered by the XSA-9 fix, this really is of more general use; that fix just pointed out very sharply that the current situation with all domain creation failures reported to user (tools) space as -ENOMEM is very unfortunate (actively misleading users _and_ support personnel). Pull over the pointer <-> error code conversion infrastructure from Linux, and use it in domain_create() and all it callers. Signed-off-by: Jan Beulich Acked-by: Keir Fraser --- xen/common/schedule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xen/common/schedule.c') diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 0854f55bf5..eee74be50f 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -1323,7 +1323,7 @@ void __init scheduler_init(void) panic("scheduler returned error on init\n"); idle_domain = domain_create(DOMID_IDLE, 0, 0); - BUG_ON(idle_domain == NULL); + BUG_ON(IS_ERR(idle_domain)); idle_domain->vcpu = idle_vcpu; idle_domain->max_vcpus = nr_cpu_ids; if ( alloc_vcpu(idle_domain, 0, 0) == NULL ) -- cgit v1.2.3