--- xen-unstable/xen/common/dom0_ops.c~ 2005-03-08 22:12:28.000000000 -0600 +++ xen-unstable/xen/common/dom0_ops.c 2005-03-09 14:03:05.000000000 -0600 @@ -114,7 +114,7 @@ case DOM0_BUILDDOMAIN: { struct domain *d = find_domain_by_id(op->u.builddomain.domain); - ret = -EINVAL; + ret = -ESRCH; if ( d != NULL ) { ret = final_setup_guest(d, &op->u.builddomain); @@ -147,10 +147,13 @@ if ( d != NULL ) { ret = -EINVAL; - if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) + if ( d != current->domain ) { - domain_unpause_by_systemcontroller(d); - ret = 0; + if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) + { + domain_unpause_by_systemcontroller(d); + ret = 0; + } } put_domain(d); }