|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH for 4.6 v4 2/3] xl/libxl: disallow saving a guest with vNUMA configured
On Fri, Sep 11, 2015 at 03:00:35PM +0100, Ian Campbell wrote:
> On Fri, 2015-09-11 at 14:50 +0100, Wei Liu wrote:
> > + /* Disallow saving a guest with vNUMA configured because migration
> > + * stream does not preserve node information.
> > + *
> > + * Do not differentiate "no vnuma configuration" from "empty vnuma
> > + * configuration".
> > + */
> > + rc = xc_domain_getvnuma(CTX->xch, domid, &nr_vnodes, &nr_vmemranges,
> > + &nr_vcpus, NULL, NULL, NULL);
> > + if (rc != -1 || errno == XEN_ENOBUFS) {
>
> This is not as we discussed, it is neither what I proposed nor what you
> (incorrectly IMHO) corrected it to be in the previous thread.
>
To avoid spamming the list I attach the updated version here.
Tested with saving guests with / without vnuma configuration.
---8<---
From 0c286535e998b62dbe0e35be4c9366fb8dc0934d Mon Sep 17 00:00:00 2001
From: Wei Liu <wei.liu2@xxxxxxxxxx>
Date: Wed, 9 Sep 2015 17:11:24 +0100
Subject: [PATCH] xl/libxl: disallow saving a guest with vNUMA configured
This is because the migration stream does not preserve node information.
Note this is not a regression for migration v2 vs legacy migration
because neither of them preserve node information.
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Cc: andrew.cooper3@xxxxxxxxxx
v4:
1. Don't differentiate "no vnuma" from "empty vnuma".
v3:
1. Update manpage, code comment and commit message.
2. *Don't* check if nomigrate is set.
---
docs/man/xl.cfg.pod.5 | 2 ++
tools/libxl/libxl_dom.c | 16 ++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index c6345b8..157c855 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -263,6 +263,8 @@ virtual node.
Note that virtual NUMA for PV guest is not yet supported, because
there is an issue with cpuid handling that affects PV virtual NUMA.
+Further more, guest with virtual NUMA cannot be saved or migrated
+because migration stream does not preserve node information.
Each B<VNODE_SPEC> is a list, which has a form of
"[VNODE_CONFIG_OPTION,VNODE_CONFIG_OPTION, ... ]" (without quotes).
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index c2518a3..72fce21 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -24,6 +24,7 @@
#include <xen/hvm/hvm_info_table.h>
#include <xen/hvm/hvm_xs_strings.h>
#include <xen/hvm/e820.h>
+#include <xen/errno.h>
libxl_domain_type libxl__domain_type(libxl__gc *gc, uint32_t domid)
{
@@ -1612,6 +1613,7 @@ void libxl__domain_save(libxl__egc *egc,
libxl__domain_suspend_state *dss)
const libxl_domain_remus_info *const r_info = dss->remus;
libxl__srm_save_autogen_callbacks *const callbacks =
&dss->sws.shs.callbacks.save.a;
+ unsigned int nr_vnodes = 0, nr_vmemranges = 0, nr_vcpus = 0;
dss->rc = 0;
logdirty_init(&dss->logdirty);
@@ -1636,6 +1638,20 @@ void libxl__domain_save(libxl__egc *egc,
libxl__domain_suspend_state *dss)
| (debug ? XCFLAGS_DEBUG : 0)
| (dss->hvm ? XCFLAGS_HVM : 0);
+ /* Disallow saving a guest with vNUMA configured because migration
+ * stream does not preserve node information.
+ *
+ * Do not differentiate "no vnuma configuration" from "empty vnuma
+ * configuration".
+ */
+ rc = xc_domain_getvnuma(CTX->xch, domid, &nr_vnodes, &nr_vmemranges,
+ &nr_vcpus, NULL, NULL, NULL);
+ if (rc != -1 || errno != XEN_EOPNOTSUPP) {
+ LOG(ERROR, "Cannot save a guest with vNUMA configured");
+ rc = ERROR_FAIL;
+ goto out;
+ }
+
dss->guest_evtchn.port = -1;
dss->guest_evtchn_lockfd = -1;
dss->guest_responded = 0;
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |