diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-09-03 09:40:38 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-09-03 09:40:38 +0200 |
commit | 8e66050e3223a9aa55ca29ec32b2e78c3e69e085 (patch) | |
tree | 22bf4997c2366565228de8bb0a31c0eaf4873be5 /xen/arch/x86/setup.c | |
parent | f1297904185f73262522b6277252bfb699644766 (diff) | |
download | xen-8e66050e3223a9aa55ca29ec32b2e78c3e69e085.tar.gz xen-8e66050e3223a9aa55ca29ec32b2e78c3e69e085.tar.bz2 xen-8e66050e3223a9aa55ca29ec32b2e78c3e69e085.zip |
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 <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/setup.c')
-rw-r--r-- | xen/arch/x86/setup.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 7fffdc4a95..57f8bc1f4e 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1,6 +1,7 @@ #include <xen/config.h> #include <xen/init.h> #include <xen/lib.h> +#include <xen/err.h> #include <xen/sched.h> #include <xen/sched-if.h> #include <xen/domain.h> @@ -1319,7 +1320,7 @@ void __init __start_xen(unsigned long mbi_p) /* Create initial domain 0. */ dom0 = domain_create(0, DOMCRF_s3_integrity, 0); - if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) ) + if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) ) panic("Error creating domain 0\n"); dom0->is_privileged = 1; |