xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH 01/15] libxc: xc_domain_restore, make toolstack_restore const-correct
Date: Wed, 30 May 2012 17:16:32 +0100	[thread overview]
Message-ID: <1338394606-22693-2-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1338394606-22693-1-git-send-email-ian.jackson@eu.citrix.com>

Also provide typedefs for the nontrivial function callback types.

Update the one provider of this callback, in libxl.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xenguest.h  |   14 ++++++++++----
 tools/libxl/libxl_dom.c |    4 ++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index 91d53f7..328a2a5 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -31,6 +31,10 @@
 #define X86_64_B_SIZE   64 
 #define X86_32_B_SIZE   32
 
+typedef int xc_switch_qemu_logdirty_cb(int domid, unsigned enable, void *data);
+typedef int xc_toolstack_save_cb(uint32_t domid, uint8_t **buf,
+                                 uint32_t *len, void *data);
+
 /* callbacks provided by xc_domain_save */
 struct save_callbacks {
     /* Called after expiration of checkpoint interval,
@@ -61,7 +65,7 @@ struct save_callbacks {
     int (*checkpoint)(void* data);
 
     /* Enable qemu-dm logging dirty pages to xen */
-    int (*switch_qemu_logdirty)(int domid, unsigned enable, void *data); /* HVM only */
+    xc_switch_qemu_logdirty_cb *switch_qemu_logdirty; /* HVM only */
 
     /* Save toolstack specific data
      * @param buf the buffer with the data to be saved
@@ -69,7 +73,7 @@ struct save_callbacks {
      * The callee allocates the buffer, the caller frees it (buffer must
      * be free'able).
      */
-    int (*toolstack_save)(uint32_t domid, uint8_t **buf, uint32_t *len, void *data);
+    xc_toolstack_save_cb *toolstack_save;
 
     /* to be provided as the last argument to each callback function */
     void* data;
@@ -89,11 +93,13 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
                    unsigned long vm_generationid_addr);
 
 
+typedef int xc_toolstack_restore_cb(uint32_t domid, const uint8_t *buf,
+                                    uint32_t size, void* data);
+
 /* callbacks provided by xc_domain_restore */
 struct restore_callbacks {
     /* callback to restore toolstack specific data */
-    int (*toolstack_restore)(uint32_t domid, uint8_t *buf,
-            uint32_t size, void* data);
+    xc_toolstack_restore_cb *toolstack_restore;
 
     /* to be provided as the last argument to each callback function */
     void* data;
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 06dbc92..929fbf2 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -465,13 +465,13 @@ static inline char *restore_helper(libxl__gc *gc, uint32_t domid,
             domid, phys_offset, node);
 }
 
-static int libxl__toolstack_restore(uint32_t domid, uint8_t *buf,
+static int libxl__toolstack_restore(uint32_t domid, const uint8_t *buf,
         uint32_t size, void *data)
 {
     libxl__gc *gc = (libxl__gc *) data;
     libxl_ctx *ctx = gc->owner;
     int i, ret;
-    uint8_t *ptr = buf;
+    const uint8_t *ptr = buf;
     uint32_t count = 0, version = 0;
     struct libxl__physmap_info* pi;
     char *xs_path;
-- 
1.7.2.5

  reply	other threads:[~2012-05-30 16:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30 16:16 [PATCH v2 00/15] libxl: domain save/restore: run in a separate process Ian Jackson
2012-05-30 16:16 ` Ian Jackson [this message]
2012-05-30 17:26   ` [PATCH 01/15] libxc: xc_domain_restore, make toolstack_restore const-correct Ian Campbell
2012-05-31  9:55     ` Ian Jackson
2012-05-31 11:16       ` Ian Campbell
2012-05-31 14:00         ` Ian Jackson
2012-05-30 16:16 ` [PATCH 02/15] libxl: domain save: rename variables etc Ian Jackson
2012-05-30 17:32   ` Ian Campbell
2012-05-31 10:02     ` Ian Jackson
2012-05-30 16:16 ` [PATCH 03/15] libxl: domain restore: reshuffle, preparing for ao Ian Jackson
2012-05-30 16:16 ` [PATCH 04/15] libxl: domain save: API changes for asynchrony Ian Jackson
2012-05-30 16:16 ` [PATCH 05/15] libxl: domain save/restore: run in a separate process Ian Jackson
2012-05-30 16:16 ` [PATCH 06/15] libxl: rename libxl_dom:save_helper to physmap_path Ian Jackson
2012-05-30 17:44   ` Ian Campbell
2012-05-30 16:16 ` [PATCH 07/15] libxl: provide libxl__xs_*_checked and libxl__xs_transaction_* Ian Jackson
2012-05-30 17:48   ` Ian Campbell
2012-05-31 10:22     ` Ian Jackson
2012-05-31 11:17       ` Ian Campbell
2012-05-30 16:16 ` [PATCH 08/15] libxl: wait for qemu to acknowledge logdirty command Ian Jackson
2012-05-30 16:16 ` [PATCH 09/15] libxl: datacopier: provide "prefix data" facilit Ian Jackson
2012-05-31  7:52   ` Ian Campbell
2012-05-31 10:32     ` Ian Jackson
2012-05-31 11:20       ` Ian Campbell
2012-05-31 14:07         ` Ian Jackson
2012-05-30 16:16 ` [PATCH 10/15] libxl: prepare for asynchronous writing of qemu save file Ian Jackson
2012-05-30 16:16 ` [PATCH 11/15] libxl: Make libxl__domain_save_device_model asynchronous Ian Jackson
2012-05-30 16:16 ` [PATCH 12/15] xl: Handle return value from libxl_domain_suspend correctly Ian Jackson
2012-05-31  7:53   ` Ian Campbell
2012-05-30 16:16 ` [PATCH 13/15] libxl: do not leak dms->saved_state Ian Jackson
2012-05-31  7:54   ` Ian Campbell
2012-05-30 16:16 ` [PATCH 14/15] libxl: do not leak spawned middle children Ian Jackson
2012-05-30 16:16 ` [PATCH 15/15] libxl: do not leak an event struct on ignored ao progress Ian Jackson
2012-05-31  7:55   ` 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=1338394606-22693-2-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.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).