[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: set guest_domid even if libxl__domain_make fails


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Mon, 14 May 2012 16:32:41 +0000
  • Delivery-date: Mon, 14 May 2012 16:33:08 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxx>
# Date 1336759143 -3600
# Node ID 86f8a5708fbfe0f8c2859041398c03f3c635d5ca
# Parent  885fdd4fd7ac807a2b0e6a322ab492f0f40d1561
libxl: set guest_domid even if libxl__domain_make fails

This is needed in order to perform the domain destruction if
libxl__domain_make fails.

Also move doc comment about error behaviour of libxl__domain_make from
implementation to declaration.

Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r 885fdd4fd7ac -r 86f8a5708fbf tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Fri May 11 18:59:03 2012 +0100
+++ b/tools/libxl/libxl_create.c        Fri May 11 18:59:03 2012 +0100
@@ -396,8 +396,6 @@ out:
 
 int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
                        uint32_t *domid)
- /* on entry, libxl_domid_valid_guest(domid) must be false;
-  * on exit (even error exit), domid may be valid and refer to a domain */
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int flags, ret, rc;
@@ -600,6 +598,7 @@ static void initiate_domain_create(libxl
     ret = libxl__domain_make(gc, &d_config->c_info, &domid);
     if (ret) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
+        dcs->guest_domid = domid;
         ret = ERROR_FAIL;
         goto error_out;
     }
diff -r 885fdd4fd7ac -r 86f8a5708fbf tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Fri May 11 18:59:03 2012 +0100
+++ b/tools/libxl/libxl_internal.h      Fri May 11 18:59:03 2012 +0100
@@ -1078,9 +1078,13 @@ _hidden void libxl__exec(int stdinfd, in
                const char *arg0, char **args); // logs errors, never returns
 
 /* from xl_create */
+
+ /* on entry, libxl_domid_valid_guest(domid) must be false;
+  * on exit (even error exit), domid may be valid and refer to a domain */
 _hidden int libxl__domain_make(libxl__gc *gc,
                                libxl_domain_create_info *info,
                                uint32_t *domid);
+
 _hidden int libxl__domain_build(libxl__gc *gc,
                                 libxl_domain_build_info *info,
                                 uint32_t domid,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.