When creating a xenstore domain via init-xenstore-domain destroy it in case of an error occurred after calling xc_domain_create().
Signed-off-by: Juergen Gross <jgr...@suse.com> Acked-by: Daniel De Graaf <dgde...@tycho.nsa.gov> --- tools/helpers/init-xenstore-domain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c index 3dd1255..6dffaef 100644 --- a/tools/helpers/init-xenstore-domain.c +++ b/tools/helpers/init-xenstore-domain.c @@ -11,7 +11,7 @@ #include <xenstore.h> #include <xen/sys/xenbus_dev.h> -static uint32_t domid = -1; +static uint32_t domid = ~0; static int build(xc_interface *xch, int argc, char** argv) { @@ -76,6 +76,8 @@ static int build(xc_interface *xch, int argc, char** argv) err: if (dom) xc_dom_release(dom); + if (domid != ~0) + xc_domain_destroy(xch, domid); close(xs_fd); return rv; } -- 2.6.2 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel