[libvirt] [PATCH] qemu: fix migration fail of an auto-placement vm after attached memory to it

Yi Wang posted 1 patch 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1500716759-47351-1-git-send-email-wang.yi59@zte.com.cn
src/qemu/qemu_process.c | 10 ++++++++++
1 file changed, 10 insertions(+)
[libvirt] [PATCH] qemu: fix migration fail of an auto-placement vm after attached memory to it
Posted by Yi Wang 6 years, 9 months ago
This patch fix this condition:
  -vm has the "auto" placement in vcpu
  -hot-plug memory with source node "1-3" through attach-device command
  -migrate the vm to a host with only 2 numa node
And the migration will fail with error:
"error: unsupported configuration: NUMA node 2 is unavailable"

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Signed-off-by: Xi Xu <xu.xi8@zte.com.cn>
---
 src/qemu/qemu_process.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7b708be..dcc564c 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5259,6 +5259,16 @@ qemuProcessPrepareDomain(virConnectPtr conn,
             goto cleanup;
     }
 
+    VIR_DEBUG("Updating memory source nodes");
+    for (i = 0; i < vm->def->nmems; i++) {
+        virDomainMemoryDefPtr mem = vm->def->mems[i];
+        if (priv->autoNodeset && mem && mem->sourceNodes) {
+            virBitmapFree(mem->sourceNodes);
+            if (!(mem->sourceNodes = virBitmapNewCopy(priv->autoNodeset)))
+                goto cleanup;
+        }
+    }
+
     /* Whether we should use virtlogd as stdio handler for character
      * devices source backend. */
     if (cfg->stdioLogD &&
-- 
1.8.3.1


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: fix migration fail of an auto-placement vm after attached memory to it
Posted by Peter Krempa 6 years, 8 months ago
On Sat, Jul 22, 2017 at 05:45:59 -0400, Yi Wang wrote:
> This patch fix this condition:
>   -vm has the "auto" placement in vcpu
>   -hot-plug memory with source node "1-3" through attach-device command
>   -migrate the vm to a host with only 2 numa node
> And the migration will fail with error:
> "error: unsupported configuration: NUMA node 2 is unavailable"
> 
> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> Signed-off-by: Xi Xu <xu.xi8@zte.com.cn>
> ---
>  src/qemu/qemu_process.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 7b708be..dcc564c 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -5259,6 +5259,16 @@ qemuProcessPrepareDomain(virConnectPtr conn,
>              goto cleanup;
>      }
>  
> +    VIR_DEBUG("Updating memory source nodes");
> +    for (i = 0; i < vm->def->nmems; i++) {
> +        virDomainMemoryDefPtr mem = vm->def->mems[i];
> +        if (priv->autoNodeset && mem && mem->sourceNodes) {
> +            virBitmapFree(mem->sourceNodes);
> +            if (!(mem->sourceNodes = virBitmapNewCopy(priv->autoNodeset)))
> +                goto cleanup;

This is not correct. This code will be executed even during normal
startup and it would remove any manual pinning the user set-up.

I think the problem might be that the XML retains the nodesets of
automatically placed memory modules while formatting the migratable XML.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list