WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: use libxl_domain_type enum with li

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: use libxl_domain_type enum with libxl__domain_suspend_common
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 23 Jul 2011 00:33:12 +0100
Delivery-date: Fri, 22 Jul 2011 16:35:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1310997150 -3600
# Node ID b373d7d341282c5a1761cc91a376a09b35572a1f
# Parent  4e872ffccc19a22bf8755c8c63ee2bccd5e20d5a
libxl: use libxl_domain_type enum with libxl__domain_suspend_common

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 4e872ffccc19 -r b373d7d34128 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon Jul 18 14:52:30 2011 +0100
+++ b/tools/libxl/libxl.c       Mon Jul 18 14:52:30 2011 +0100
@@ -474,13 +474,13 @@
                          uint32_t domid, int fd)
 {
     libxl__gc gc = LIBXL_INIT_GC(ctx);
-    int hvm = LIBXL__DOMAIN_IS_TYPE(&gc,  domid, HVM);
+    libxl_domain_type type = libxl__domain_type(&gc, domid);
     int live = info != NULL && info->flags & XL_SUSPEND_LIVE;
     int debug = info != NULL && info->flags & XL_SUSPEND_DEBUG;
     int rc = 0;
 
-    rc = libxl__domain_suspend_common(&gc, domid, fd, hvm, live, debug);
-    if (!rc && hvm)
+    rc = libxl__domain_suspend_common(&gc, domid, fd, type, live, debug);
+    if (!rc && type == LIBXL_DOMAIN_TYPE_HVM)
         rc = libxl__domain_save_device_model(&gc, domid, fd);
     libxl__free_all(&gc);
     return rc;
diff -r 4e872ffccc19 -r b373d7d34128 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Mon Jul 18 14:52:30 2011 +0100
+++ b/tools/libxl/libxl_dom.c   Mon Jul 18 14:52:30 2011 +0100
@@ -513,14 +513,26 @@
 }
 
 int libxl__domain_suspend_common(libxl__gc *gc, uint32_t domid, int fd,
-               int hvm, int live, int debug)
+                                 libxl_domain_type type,
+                                 int live, int debug)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int flags;
     int port;
     struct save_callbacks callbacks;
     struct suspendinfo si;
-    int rc = ERROR_FAIL;
+    int hvm, rc = ERROR_FAIL;
+
+    switch (type) {
+    case LIBXL_DOMAIN_TYPE_HVM:
+        hvm = 1;
+        break;
+    case LIBXL_DOMAIN_TYPE_PV:
+        hvm = 0;
+        break;
+    default:
+        return ERROR_INVAL;
+    }
 
     flags = (live) ? XCFLAGS_LIVE : 0
           | (debug) ? XCFLAGS_DEBUG : 0
diff -r 4e872ffccc19 -r b373d7d34128 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Mon Jul 18 14:52:30 2011 +0100
+++ b/tools/libxl/libxl_internal.h      Mon Jul 18 14:52:30 2011 +0100
@@ -199,7 +199,9 @@
                                          libxl_domain_build_info *info,
                                          libxl__domain_build_state *state,
                                          int fd);
-_hidden int libxl__domain_suspend_common(libxl__gc *gc, uint32_t domid, int 
fd, int hvm, int live, int debug);
+_hidden int libxl__domain_suspend_common(libxl__gc *gc, uint32_t domid, int fd,
+                                         libxl_domain_type type,
+                                         int live, int debug);
 _hidden int libxl__domain_save_device_model(libxl__gc *gc, uint32_t domid, int 
fd);
 _hidden void libxl__userdata_destroyall(libxl__gc *gc, uint32_t domid);
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: use libxl_domain_type enum with libxl__domain_suspend_common, Xen patchbot-unstable <=