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 <jgross@suse.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
#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)
{
err:
if ( dom )
xc_dom_release(dom);
+ if ( domid != ~0 )
+ xc_domain_destroy(xch, domid);
close(xs_fd);
return rv;
}