From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH VERY RFC 4/5] tools/xl: Restore v2 streams using new libxl_domain_restore() interface
Date: Wed, 3 Sep 2014 18:14:10 +0100 [thread overview]
Message-ID: <1409764451-13053-5-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1409764451-13053-1-git-send-email-andrew.cooper3@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
tools/libxl/xl_cmdimpl.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index e6b9615..8e0a6bb 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -136,6 +136,8 @@ static const char *action_on_shutdown_names[] = {
#define SAVEFILE_BYTEORDER_VALUE ((uint32_t)0x01020304UL)
+#define SAVEFILE_MANDATORY_STREAMV2 (1 << 0)
+
struct domain_create {
int debug;
int daemonize;
@@ -2115,7 +2117,7 @@ static uint32_t create_domain(struct domain_create *dom_info)
restore_source, hdr.mandatory_flags, hdr.optional_flags,
hdr.optional_data_len);
- badflags = hdr.mandatory_flags & ~( 0 /* none understood yet */ );
+ badflags = hdr.mandatory_flags & ~SAVEFILE_MANDATORY_STREAMV2;
if (badflags) {
fprintf(stderr, "Savefile has mandatory flag(s) 0x%"PRIx32" "
"which are not supported; need newer xl\n",
@@ -2245,12 +2247,17 @@ start:
}
if ( restoring ) {
- libxl_domain_restore_params params;
- params.checkpointed_stream = dom_info->checkpointed_stream;
- ret = libxl_domain_create_restore(ctx, &d_config,
- &domid, restore_fd,
- ¶ms,
- 0, autoconnect_console_how);
+ if ( hdr.mandatory_flags & SAVEFILE_MANDATORY_STREAMV2 ) {
+ ret = libxl_domain_restore(ctx, &d_config, restore_fd, &domid,
+ 0, autoconnect_console_how);
+ } else {
+ libxl_domain_restore_params params;
+ params.checkpointed_stream = dom_info->checkpointed_stream;
+ ret = libxl_domain_create_restore(ctx, &d_config,
+ &domid, restore_fd,
+ ¶ms,
+ 0, autoconnect_console_how);
+ }
/*
* On subsequent reboot etc we should create the domain, not
* restore/migrate-receive it again.
--
1.7.10.4
next prev parent reply other threads:[~2014-09-03 17:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 17:14 [PATCH VERY RFC 0/5] Libxl migration v2 support Andrew Cooper
2014-09-03 17:14 ` [PATCH VERY RFC 1/5] tools/libxl: Add support for writing a set of buffers asynchronously Andrew Cooper
2014-09-04 1:28 ` Wen Congyang
2014-09-03 17:14 ` [PATCH VERY RFC 2/5] tools/libxl: Stream v2 format Andrew Cooper
2014-09-03 17:14 ` [PATCH VERY RFC 3/5] tools/libxl: Implement libxl_domain_restore() for v2 streams Andrew Cooper
2014-09-03 17:14 ` Andrew Cooper [this message]
2014-09-03 17:14 ` [PATCH VERY RFC 5/5] tools/[lib]xl: Alter libxl_domain_suspend() to write a v2 stream Andrew Cooper
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=1409764451-13053-5-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@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).