From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Jones <drjones@redhat.com>,
David Vrabel <david.vrabel@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Subject: [PATCH RFC/WIP 3/4] libxl: add SHUTDOWN_kexec state support
Date: Mon, 25 Aug 2014 15:42:25 +0200 [thread overview]
Message-ID: <1408974146-6519-4-git-send-email-vkuznets@redhat.com> (raw)
In-Reply-To: <1408974146-6519-1-git-send-email-vkuznets@redhat.com>
Add kexec to domain suspend state and treat a domain as already suspended
and successfully responded to suspend request if the flag is set.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
tools/libxl/libxl.c | 1 +
tools/libxl/libxl.h | 1 +
tools/libxl/libxl_dom.c | 6 ++++++
tools/libxl/libxl_internal.h | 1 +
4 files changed, 9 insertions(+)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2d29ad2..0ba3285 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -786,6 +786,7 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
dss->type = type;
dss->live = flags & LIBXL_SUSPEND_LIVE;
dss->debug = flags & LIBXL_SUSPEND_DEBUG;
+ dss->kexec = flags & LIBXL_SUSPEND_KEXEC;
libxl__domain_suspend(egc, dss);
return AO_INPROGRESS;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 06bbca6..c8185f9 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -689,6 +689,7 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd,
LIBXL_EXTERNAL_CALLERS_ONLY;
#define LIBXL_SUSPEND_DEBUG 1
#define LIBXL_SUSPEND_LIVE 2
+#define LIBXL_SUSPEND_KEXEC 4
/* @param suspend_cancel [from xenctrl.h:xc_domain_resume( @param fast )]
* If this parameter is true, use co-operative resume. The guest
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 69e6088..b2f3a09 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1038,6 +1038,12 @@ int libxl__domain_suspend_common_callback(void *user)
/* Convenience aliases */
const uint32_t domid = dss->domid;
+ if (dss->kexec) {
+ /* No suspend required if we're in SHUTDOWN_kexec */
+ dss->guest_responded = 1;
+ goto guest_suspended;
+ }
+
if (dss->hvm) {
xc_get_hvm_param(CTX->xch, domid, HVM_PARAM_CALLBACK_IRQ, &hvm_pvdrv);
xc_get_hvm_param(CTX->xch, domid, HVM_PARAM_ACPI_S_STATE, &hvm_s_state);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 9d17586..cdef241 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2314,6 +2314,7 @@ struct libxl__domain_suspend_state {
libxl_domain_type type;
int live;
int debug;
+ int kexec;
const libxl_domain_remus_info *remus;
/* private */
xc_evtchn *xce; /* event channel handle */
--
1.9.3
next prev parent reply other threads:[~2014-08-25 13:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-25 13:42 [PATCH RFC/WIP 0/4] toolstack-based approach to pvhvm guest kexec Vitaly Kuznetsov
2014-08-25 13:42 ` [PATCH RFC/WIP 1/4] Introduce SHUTDOWN_kexec shutdown reason Vitaly Kuznetsov
2014-08-25 14:03 ` Jan Beulich
2014-08-26 10:16 ` David Vrabel
2014-08-26 12:40 ` Jan Beulich
2014-08-26 13:25 ` David Vrabel
2014-08-25 13:42 ` [PATCH RFC/WIP 2/4] libxc: treat domain in SHUTDOWN_kexec state as being already suspended Vitaly Kuznetsov
2014-08-25 14:01 ` Andrew Cooper
2014-08-25 13:42 ` Vitaly Kuznetsov [this message]
2014-08-25 13:42 ` [PATCH RFC/WIP 4/4] libxl: rebuild guest domains on kexec Vitaly Kuznetsov
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=1408974146-6519-4-git-send-email-vkuznets@redhat.com \
--to=vkuznets@redhat.com \
--cc=JBeulich@suse.com \
--cc=david.vrabel@citrix.com \
--cc=drjones@redhat.com \
--cc=xen-devel@lists.xenproject.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).