Skip to contentSkip to conversation

More vNUMA patches

PATCH Superseded Wei Liu 2 participants 5 messages Sep 8, 2015

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover More vNUMA patches

Discovered some fallouts when I tried to fix a migration v2 bug.

Wei Liu (2):
libxl: set ret to non-zero value in failure path xl/libxl: disallow restoring guest with vNUMA configured

 docs/man/xl.cfg.pod.5      |  2 ++
 tools/libxl/libxl_create.c | 11 +++++++++++
 2 files changed, 13 insertions(+)
Signature · 1 line
2.1.4
author
#1 lore raw

PATCH 1/2 libxl: set ret to non-zero value in failure path

... otherwise we have something like:

xl: libxl_create.c:968: initiate_domain_create: Assertion `ret' failed.

---
 tools/libxl/libxl_create.c | 1 +
 1 file changed, 1 insertion(+)
tools/libxl/libxl_create.c +1 -0
index 5128160..29c2641 100644
@@ -865,6 +865,7 @@ static void initiate_domain_create(libxl__egc *egc,
      */
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
         d_config->b_info.num_vnuma_nodes) {
+        ret = ERROR_INVAL;
         LOG(ERROR, "PV vNUMA is not yet supported");
         goto error_out;
     }
Signature · 1 line
2.1.4
author
#2 lore raw

PATCH 2/2 xl/libxl: disallow restoring guest with vNUMA configured

In reply to Wei Liu

This is due to restoring a guest uses another path different from the creation path and migration v2 frame record doesn't contain node information.

---
Cc: [email protected]

I don't think this is specific to migration v2. Legacy migration suffers from the same issue but it's already gone.

Embedding node information in frame record seems easy but at this point of release I don't want to rush to a solution.

---
 docs/man/xl.cfg.pod.5      |  2 ++
 tools/libxl/libxl_create.c | 10 ++++++++++
 2 files changed, 12 insertions(+)
docs/man/xl.cfg.pod.5 +2 -0
index 80e51bb..3b924c7 100644
@@ -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 restored or migrated
+because node information of guest frames is not preserved.
 
 Each B<VNODE_SPEC> is a list, which has a form of
 "[VNODE_CONFIG_OPTION,VNODE_CONFIG_OPTION, ... ]"  (without quotes).
tools/libxl/libxl_create.c +10 -0
index 29c2641..69c3168 100644
@@ -870,6 +870,16 @@ static void initiate_domain_create(libxl__egc *egc,
         goto error_out;
     }
 
+    /* Disallow restoring a guest with vNUMA because migration v2
+     * record doesn't preserve node information for a particular guest
+     * frame.
+     */
+    if (d_config->b_info.num_vnuma_nodes && restore_fd >= 0) {
+        ret = ERROR_INVAL;
+        LOG(ERROR, "Cannot restore a guest with vNUMA configured");
+        goto error_out;
+    }
+
     ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
     if (ret) {
         LOG(ERROR, "Unable to set domain create info defaults");
Signature · 1 line
2.1.4
#3 lore raw

Re: [PATCH for 4.6 2/2] xl/libxl: disallow restoring guest with vNUMA configured

Wei Liu writes ("[PATCH for 4.6 2/2] xl/libxl: disallow restoring guest with vNUMA configured"):

Quoted 3 lines

This is due to restoring a guest uses another path different from the creation path and migration v2 frame record doesn't contain node information.

The effect of this would be that you could do xl save' but that xl restore' would later fail.

Surely that's not right.

Ian.

author
#4 lore raw

Re: [PATCH for 4.6 2/2] xl/libxl: disallow restoring guest with vNUMA configured

Quoted 10 lines · Ian Jackson

Wei Liu writes ("[PATCH for 4.6 2/2] xl/libxl: disallow restoring guest with vNUMA configured"):

Quoted 3 lines

This is due to restoring a guest uses another path different from the creation path and migration v2 frame record doesn't contain node information.

The effect of this would be that you could do xl save' but that xl restore' would later fail.

Surely that's not right.

Right. My brain was working backward -- I discovered this thing in restore code.

I will modify save code instead. One thing is that libxl__domain_save doesn't have domain config available to look at. I guess I can query hypervisor to know if vNUMA is configured.

Wei.

Quoted 1 line

Ian.