From: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
To: xen-devel <xen-devel@lists.xensource.com>
Cc: "\"柳澤佳里(yanagisawa yoshisato)\""
<yanagisawa.yoshisato@lab.ntt.co.jp>,
"Ian Pratt" <ian.pratt@citrix.com>,
ian.jackson@eu.citrix.com,
"Keir Fraser" <keir.fraser@eu.citrix.com>,
"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>
Subject: [RFC][PATCH 04/13] Kemari: Kemari controller interface in libxc
Date: Thu, 12 Mar 2009 10:17:07 +0900 [thread overview]
Message-ID: <49B86293.80505@lab.ntt.co.jp> (raw)
In-Reply-To: <49B86208.2020205@lab.ntt.co.jp>
This is an updated version of the following patch. No major changes.
http://lists.xensource.com/archives/html/xen-devel/2009-03/msg00372.html
Signed-off-by: Yoshisato Yanagisawa <yanagisawa.yoshisato@lab.ntt.co.jp>
Signed-off-by: Yoshi Tamura <tamura.yoshiaki@lab.ntt.co.jp>
---
tools/libxc/Makefile | 2 +
tools/libxc/xc_dom_kemari.c | 79 ++++++++++++++++++++++++++++++++++++++++++
tools/libxc/xenctrl.h | 13 +++++-
tools/libxc/xenguest.h | 45 +++++++++++++++++++++++
tools/libxc/xg_save_restore.h | 1
tools/xcutils/Makefile | 1
6 files changed, 139 insertions(+), 2 deletions(-)
diff -r b249f3e979a5 -r cf6a910e3663 tools/xcutils/Makefile
--- a/tools/xcutils/Makefile Mon Mar 09 10:32:24 2009 +0000
+++ b/tools/xcutils/Makefile Wed Mar 11 18:03:47 2009 +0900
@@ -15,6 +15,7 @@
CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore)
PROGRAMS = xc_restore xc_save readnotes lsevtchn
+PROGRAMS += xc_kemari_restore xc_kemari_save
LDLIBS = $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenguest) $(LDFLAGS_libxenstore)
diff -r b249f3e979a5 -r cf6a910e3663 tools/libxc/Makefile
--- a/tools/libxc/Makefile Mon Mar 09 10:32:24 2009 +0000
+++ b/tools/libxc/Makefile Wed Mar 11 18:03:47 2009 +0900
@@ -31,6 +31,8 @@
GUEST_SRCS-y :=
GUEST_SRCS-y += xg_private.c
GUEST_SRCS-$(CONFIG_MIGRATE) += xc_domain_restore.c xc_domain_save.c
+GUEST_SRCS-$(CONFIG_MIGRATE) += xc_dom_kemari_restore.c xc_dom_kemari_save.c
+GUEST_SRCS-$(CONFIG_MIGRATE) += xc_dom_kemari.c
GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
vpath %.c ../../xen/common/libelf
diff -r b249f3e979a5 -r cf6a910e3663 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Mon Mar 09 10:32:24 2009 +0000
+++ b/tools/libxc/xenctrl.h Wed Mar 11 18:03:47 2009 +0900
@@ -1041,8 +1041,8 @@
*/
xc_error_handler xc_set_error_handler(xc_error_handler handler);
-int xc_set_hvm_param(int handle, domid_t dom, int param, unsigned long value);
-int xc_get_hvm_param(int handle, domid_t dom, int param, unsigned long *value);
+int xc_set_hvm_param(int handle, domid_t dom, int param, uint64_t value);
+int xc_get_hvm_param(int handle, domid_t dom, int param, uint64_t *value);
/* IA64 specific, nvram save */
int xc_ia64_save_to_nvram(int xc_handle, uint32_t dom);
@@ -1242,4 +1242,13 @@
int xc_set_cpufreq_gov(int xc_handle, int cpuid, char *govname);
int xc_set_cpufreq_para(int xc_handle, int cpuid,
int ctrl_type, int ctrl_value);
+
+/* kemari control interface */
+int xc_kemari_control(int xc_handle,
+ uint32_t domid,
+ uint32_t cmd,
+ evtchn_port_t *port,
+ uint32_t *num_pages,
+ uint64_t *mfn,
+ uint16_t tap_mode);
#endif /* XENCTRL_H */
diff -r b249f3e979a5 -r cf6a910e3663 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h Mon Mar 09 10:32:24 2009 +0000
+++ b/tools/libxc/xenguest.h Wed Mar 11 18:03:47 2009 +0900
@@ -43,6 +43,51 @@
* @return 0 on success, -1 on failure
*/
int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
+ unsigned int store_evtchn, unsigned long *store_mfn,
+ unsigned int console_evtchn, unsigned long *console_mfn,
+ unsigned int hvm, unsigned int pae);
+
+/**
+ * This function will save a running domain for Kemari.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm fd the file descriptor to save a domain to
+ * @parm dom the id of the domain
+ * @return 0 on success, -1 on failure
+ */
+int xc_kemari_save(int xc_handle, int io_fd, uint32_t dom,
+ void *kemari_ring, uint32_t flags /* XCFLAGS_xxx */,
+ int hvm,
+ void *(*init_qemu_maps)(int, unsigned));
+
+/**
+ * This function will update a domain for Kemari.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm fd the file descriptor to save a domain to
+ * @parm dom the id of the domain
+ * @return 0 on success, -1 on failure
+ */
+int xc_kemari_update(int xc_handle, int io_fd, uint32_t dom,
+ void *kemari_ring, uint32_t flags,
+ void (*qemu_save_image)(int),
+ void (*qemu_end_flip)(void),
+ void (*qemu_end_save)(void),
+ void (*qemu_image_sent)(void));
+
+/**
+ * This function will restore a saved domain for Kemari.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm fd the file descriptor to restore a domain from
+ * @parm dom the id of the domain
+ * @parm store_evtchn the store event channel for this domain to use
+ * @parm store_mfn returned with the mfn of the store page
+ * @parm hvm non-zero if this is a HVM restore
+ * @parm pae non-zero if this HVM domain has PAE support enabled
+ * @return 0 on success, -1 on failure
+ */
+int xc_kemari_restore(int xc_handle, int io_fd, uint32_t dom,
unsigned int store_evtchn, unsigned long *store_mfn,
unsigned int console_evtchn, unsigned long *console_mfn,
unsigned int hvm, unsigned int pae);
diff -r b249f3e979a5 -r cf6a910e3663 tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h Mon Mar 09 10:32:24 2009 +0000
+++ b/tools/libxc/xg_save_restore.h Wed Mar 11 18:03:47 2009 +0900
@@ -8,6 +8,7 @@
#include <xen/foreign/x86_32.h>
#include <xen/foreign/x86_64.h>
+#include <xen/kemari.h>
/*
** We process save/restore/migrate in batches of pages; the below
diff -r b249f3e979a5 -r cf6a910e3663 tools/libxc/xc_dom_kemari.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxc/xc_dom_kemari.c Wed Mar 11 18:03:47 2009 +0900
@@ -0,0 +1,79 @@
+/*
+ * xc_dom_kemari.c
+ *
+ * The API for manipulating and obtaining information on kemari-domains.
+ *
+ * Copyright (C) 2008 Nippon Telegraph and Telephone Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "xc_private.h"
+
+/*
+ * Kemari controller interface.
+ */
+int xc_kemari_control(int xc_handle,
+ uint32_t domid,
+ uint32_t cmd,
+ evtchn_port_t *port,
+ uint32_t *num_pages,
+ uint64_t *mfn,
+ uint16_t tap_mode)
+{
+ int rc;
+ struct xen_domctl_kemari_op *kemari_op;
+ DECLARE_DOMCTL;
+
+ domctl.cmd = XEN_DOMCTL_kemari_op;
+ domctl.domain = (domid_t)domid;
+
+ kemari_op = &domctl.u.kemari_op;
+ kemari_op->cmd = cmd;
+
+ if ( cmd == XEN_KEMARI_OP_attach )
+ {
+ kemari_op->u.attach.port = *port;
+ kemari_op->u.attach.evtchn_tap_mode = tap_mode;
+ }
+
+ if ( cmd /* == */ & XEN_KEMARI_OP_detach )
+ kemari_op->u.detach.port = *port;
+
+ DPRINTF("xc_kemari_control: cmd=%d\n", cmd);
+
+ rc = do_domctl(xc_handle, &domctl);
+
+ if ( cmd == XEN_KEMARI_OP_enable )
+ {
+ *port = kemari_op->u.enable.port;
+ *mfn = kemari_op->u.enable.mfn;
+ *num_pages = kemari_op->u.enable.num_pages;
+ }
+
+ return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
+
next prev parent reply other threads:[~2009-03-12 1:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 1:14 [RFC][PATCH 00/13] Kemari: updated to the 3.4 unstable tree Yoshiaki Tamura
2009-03-12 1:15 ` [RFC][PATCH 01/13] Kemari: add ECS_TAP state to event channel Yoshiaki Tamura
2009-03-12 1:16 ` [RFC][PATCH 02/13] Kemari: core kemari code Yoshiaki Tamura
2009-03-12 1:16 ` [RFC][PATCH 03/13] Kemari: change parameter type of xc_{set, get}_hvm_param Yoshiaki Tamura
2009-03-12 1:17 ` Yoshiaki Tamura [this message]
2009-03-12 1:17 ` [RFC][PATCH 05/13] Kemari: Kemari sender Yoshiaki Tamura
2009-03-24 6:59 ` Yoshiaki Tamura
2009-03-12 1:18 ` [RFC][PATCH 06/13] Kemari: Kemari receiver Yoshiaki Tamura
2009-03-12 1:19 ` [RFC][PATCH 07/13] Kemari: add Kemari support to python Yoshiaki Tamura
2009-03-12 1:19 ` [RFC][PATCH 08/13] Kemari: add dev state "Attached" " Yoshiaki Tamura
2009-03-12 1:20 ` [RFC][PATCH 09/13] Kemari: add XenbusStateAttached to xenbus Yoshiaki Tamura
2009-03-12 1:23 ` [RFC][PATCH 13/13] Kemari: use shared region with to flip logdirty_bitmap Yoshiaki Tamura
2009-03-24 6:59 ` Yoshiaki Tamura
-- strict thread matches above, loose matches on Subject: below --
2009-03-06 5:47 [RFC][PATCH 00/13] Kemari: VM synchronization mechanism for fault tolerance Yoshiaki Tamura
2009-03-06 5:56 ` [RFC][PATCH 04/13] Kemari: Kemari controller interface in libxc Yoshiaki Tamura
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=49B86293.80505@lab.ntt.co.jp \
--to=tamura.yoshiaki@lab.ntt.co.jp \
--cc=ian.jackson@eu.citrix.com \
--cc=ian.pratt@citrix.com \
--cc=keir.fraser@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
--cc=yanagisawa.yoshisato@lab.ntt.co.jp \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.