xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xen.org, Ian.Campbell@citrix.com,
	ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com,
	wei.liu2@citrix.com, dgdegra@tycho.nsa.gov
Cc: Juergen Gross <jgross@suse.com>
Subject: [PATCH v4 06/14] xenstore: destroy xenstore domain in case of error after creating it
Date: Mon, 18 Jan 2016 09:03:56 +0100	[thread overview]
Message-ID: <1453104244-6268-7-git-send-email-jgross@suse.com> (raw)
In-Reply-To: <1453104244-6268-1-git-send-email-jgross@suse.com>

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>
---
 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 9c47af1..a9c5821 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)
 {
@@ -94,6 +94,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

  parent reply	other threads:[~2016-01-18  8:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18  8:03 [PATCH v4 00/14] xenstore: make it easier to run xenstore in a domain Juergen Gross
2016-01-18  8:03 ` [PATCH v4 01/14] libxc: support new xenstore domain flag in libxc Juergen Gross
2016-01-18  8:03 ` [PATCH v4 02/14] libxl: provide a flag in dominfo to avoid stopping it Juergen Gross
2016-01-18  8:03 ` [PATCH v4 03/14] xenstore: move init-xenstore-domain to tools/helpers Juergen Gross
2016-01-18  8:03 ` [PATCH v4 04/14] xenstore: adjust coding style of init-xenstore-domain.c Juergen Gross
2016-01-18  8:03 ` [PATCH v4 05/14] libxl: move xen-init-dom0 to tools/helpers Juergen Gross
2016-01-18  8:03 ` Juergen Gross [this message]
2016-01-18  8:03 ` [PATCH v4 07/14] xenstore: add error messages to init-xenstore-domain Juergen Gross
2016-01-18  8:03 ` [PATCH v4 08/14] xenstore: modify init-xenstore-domain parameter syntax Juergen Gross
2016-01-18  8:03 ` [PATCH v4 09/14] xenstore: make use of the "xenstore domain" flag Juergen Gross
2016-01-18  8:04 ` [PATCH v4 10/14] xenstore: add init-xenstore-domain parameter to specify cmdline Juergen Gross
2016-01-18  8:04 ` [PATCH v4 11/14] tools: split up xen-init-dom0.c Juergen Gross
2016-01-18  8:04 ` [PATCH v4 12/14] xenstore: write xenstore domain data to xenstore Juergen Gross
2016-01-18  8:04 ` [PATCH v4 13/14] tools: don't stop xenstore domain when stopping dom0 Juergen Gross
2016-01-18  8:04 ` [PATCH v4 14/14] docs: document xenstore domain xenstore paths Juergen Gross
2016-01-18 16:55 ` [PATCH v4 00/14] xenstore: make it easier to run xenstore in a domain Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453104244-6268-7-git-send-email-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).