render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a1c947
From 81f8b07ed1e4e485ded7f366739c110351120785 Mon Sep 17 00:00:00 2001
a1c947
Message-Id: <81f8b07ed1e4e485ded7f366739c110351120785@dist-git>
a1c947
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
a1c947
Date: Thu, 21 Jul 2022 19:29:05 +0200
a1c947
Subject: [PATCH] qemu: introduce capability
a1c947
 QEMU_CAPS_MIGRATION_BLOCKED_REASONS
a1c947
MIME-Version: 1.0
a1c947
Content-Type: text/plain; charset=UTF-8
a1c947
Content-Transfer-Encoding: 8bit
a1c947
a1c947
since qemu 6.0, if migration is blocked for some reason, 'query-migrate'
a1c947
will return an array of error strings describing the migration blockers.
a1c947
This can be used to check whether there are any devices blocking
a1c947
migration, etc.
a1c947
a1c947
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
a1c947
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
a1c947
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
a1c947
Reviewed-by: Laine Stump <laine@redhat.com>
a1c947
a1c947
(cherry picked from commit 1e9d84d9f9513a73572842db30e3d1445e892291)
a1c947
Resolves: https://bugzilla.redhat.com/2092833
a1c947
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
a1c947
---
a1c947
 src/qemu/qemu_capabilities.c                      | 2 ++
a1c947
 src/qemu/qemu_capabilities.h                      | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml   | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml  | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml  | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml   | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml  | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml   | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml  | 1 +
a1c947
 tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml  | 1 +
a1c947
 13 files changed, 14 insertions(+)
a1c947
a1c947
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
a1c947
index 8586930266..48002f3b58 100644
a1c947
--- a/src/qemu/qemu_capabilities.c
a1c947
+++ b/src/qemu/qemu_capabilities.c
a1c947
@@ -671,6 +671,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
a1c947
               "chardev.qemu-vdagent", /* QEMU_CAPS_CHARDEV_QEMU_VDAGENT */
a1c947
               "display-dbus", /* QEMU_CAPS_DISPLAY_DBUS */
a1c947
               "iothread.thread-pool-max", /* QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX */
a1c947
+              "migration.blocked-reasons", /* QEMU_CAPS_MIGRATION_BLOCKED_REASONS */
a1c947
     );
a1c947
 
a1c947
 
a1c947
@@ -1623,6 +1624,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
a1c947
     { "chardev-add/arg-type/backend/+qemu-vdagent", QEMU_CAPS_CHARDEV_QEMU_VDAGENT },
a1c947
     { "query-display-options/ret-type/+dbus", QEMU_CAPS_DISPLAY_DBUS },
a1c947
     { "object-add/arg-type/+iothread/thread-pool-max", QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX },
a1c947
+    { "query-migrate/ret-type/blocked-reasons", QEMU_CAPS_MIGRATION_BLOCKED_REASONS },
a1c947
 };
a1c947
 
a1c947
 typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;
a1c947
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
a1c947
index 6f35ba1485..570e43292d 100644
a1c947
--- a/src/qemu/qemu_capabilities.h
a1c947
+++ b/src/qemu/qemu_capabilities.h
a1c947
@@ -650,6 +650,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
a1c947
     QEMU_CAPS_CHARDEV_QEMU_VDAGENT, /* -chardev qemu-vdagent */
a1c947
     QEMU_CAPS_DISPLAY_DBUS, /* -display dbus */
a1c947
     QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX, /* -object iothread.thread-pool-max */
a1c947
+    QEMU_CAPS_MIGRATION_BLOCKED_REASONS, /* query-migrate returns 'blocked-reasons */
a1c947
 
a1c947
     QEMU_CAPS_LAST /* this must always be the last item */
a1c947
 } virQEMUCapsFlags;
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
a1c947
index 4b4cc2d3aa..3e48d17811 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml
a1c947
@@ -189,6 +189,7 @@
a1c947
   <flag name='memory-backend-file.prealloc-threads'/>
a1c947
   <flag name='virtio-iommu-pci'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>6000000</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>61700242</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
a1c947
index 06543071aa..790b7221d4 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml
a1c947
@@ -147,6 +147,7 @@
a1c947
   <flag name='memory-backend-file.prealloc-threads'/>
a1c947
   <flag name='virtio-iommu-pci'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>6000000</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>39100242</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
a1c947
index 8c61bf8a84..86c3732c72 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
a1c947
@@ -231,6 +231,7 @@
a1c947
   <flag name='memory-backend-file.prealloc-threads'/>
a1c947
   <flag name='virtio-iommu-pci'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>6000000</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>43100242</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
a1c947
index afd8f606eb..bd76a7a398 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml
a1c947
@@ -236,6 +236,7 @@
a1c947
   <flag name='virtio-iommu-pci'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
   <flag name='chardev.qemu-vdagent'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>6001000</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>43100243</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
a1c947
index 86fc46918f..6ed51ec796 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml
a1c947
@@ -201,6 +201,7 @@
a1c947
   <flag name='virtio-iommu-pci'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
   <flag name='chardev.qemu-vdagent'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>6001050</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>61700244</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
a1c947
index 983b54430d..1a98fe122e 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
a1c947
@@ -196,6 +196,7 @@
a1c947
   <flag name='memory-backend-file.prealloc-threads'/>
a1c947
   <flag name='virtio-iommu-pci'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>6002000</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>42900244</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
a1c947
index 19605d93ae..a77efaaa37 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml
a1c947
@@ -238,6 +238,7 @@
a1c947
   <flag name='virtio-iommu-pci'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
   <flag name='chardev.qemu-vdagent'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>6002000</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>43100244</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml
a1c947
index e24e2235fb..6848a075a8 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml
a1c947
@@ -209,6 +209,7 @@
a1c947
   <flag name='virtio-iommu.boot-bypass'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
   <flag name='chardev.qemu-vdagent'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>6002092</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>61700243</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml
a1c947
index 83e0f50e3a..cf4286b78b 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml
a1c947
@@ -213,6 +213,7 @@
a1c947
   <flag name='virtio-iommu.boot-bypass'/>
a1c947
   <flag name='virtio-net.rss'/>
a1c947
   <flag name='chardev.qemu-vdagent'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>7000000</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>42900243</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml
a1c947
index 05f844fd5b..8e2c1652f9 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml
a1c947
@@ -243,6 +243,7 @@
a1c947
   <flag name='virtio-net.rss'/>
a1c947
   <flag name='chardev.qemu-vdagent'/>
a1c947
   <flag name='display-dbus'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>7000000</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>43100243</microcodeVersion>
a1c947
diff --git a/tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml
a1c947
index 3707d9b7c9..9bdb207c4e 100644
a1c947
--- a/tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml
a1c947
+++ b/tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml
a1c947
@@ -244,6 +244,7 @@
a1c947
   <flag name='chardev.qemu-vdagent'/>
a1c947
   <flag name='display-dbus'/>
a1c947
   <flag name='iothread.thread-pool-max'/>
a1c947
+  <flag name='migration.blocked-reasons'/>
a1c947
   <version>7000050</version>
a1c947
   <kvmVersion>0</kvmVersion>
a1c947
   <microcodeVersion>43100244</microcodeVersion>
a1c947
-- 
a1c947
2.35.1
a1c947