[libvirt] [PATCH 6/8] virQEMUCapsSetFromNodes: Skip setting deprecated flags

Ján Tomko jtomko at redhat.com
Thu Feb 21 15:42:28 UTC 2019


Prepare for removal of deprecated flags from the capability
string array and quietly drop flags present in the deprecated
string array if they were not found in the main array.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/qemu/qemu_capabilities.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b12f5914aa..ce50cfdfa5 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3460,9 +3460,15 @@ virQEMUCapsSetFromNodes(virQEMUCapsPtr qemuCaps,
         }
         flag = virQEMUCapsTypeFromString(str);
         if (flag < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Unknown qemu capabilities flag %s"), str);
-            goto cleanup;
+            flag = virQEMUCapsDeprecatedTypeFromString(str);
+            if (flag < 0) {
+                virReportError(VIR_ERR_INTERNAL_ERROR,
+                               _("Unknown qemu capabilities flag %s"), str);
+                goto cleanup;
+            } else {
+                VIR_FREE(str);
+                continue;
+            }
         }
         VIR_FREE(str);
         virQEMUCapsSet(qemuCaps, flag);
-- 
2.19.2




More information about the libvir-list mailing list