[libvirt] [PATCH v2 1/2] qemu_capabilities; Drop virQEMUCapsSetVAList

Michal Privoznik posted 2 patches 5 years, 8 months ago
[libvirt] [PATCH v2 1/2] qemu_capabilities; Drop virQEMUCapsSetVAList
Posted by Michal Privoznik 5 years, 8 months ago
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_capabilities.c | 15 +++------------
 src/qemu/qemu_capabilities.h |  2 --
 tests/qemuxml2argvtest.c     |  6 +++++-
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index c5954edaf0..56228e7a36 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1663,24 +1663,15 @@ virQEMUCapsSet(virQEMUCapsPtr qemuCaps,
 }
 
 
-void
-virQEMUCapsSetVAList(virQEMUCapsPtr qemuCaps,
-                     va_list list)
-{
-    int flag;
-
-    while ((flag = va_arg(list, int)) < QEMU_CAPS_LAST)
-        ignore_value(virBitmapSetBit(qemuCaps->flags, flag));
-}
-
-
 void
 virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...)
 {
     va_list list;
+    int flag;
 
     va_start(list, qemuCaps);
-    virQEMUCapsSetVAList(qemuCaps, list);
+    while ((flag = va_arg(list, int)) < QEMU_CAPS_LAST)
+        virQEMUCapsSet(qemuCaps, flag);
     va_end(list);
 }
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 7625d754a3..06c7606e2f 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -518,8 +518,6 @@ virQEMUCapsPtr virQEMUCapsNew(void);
 void virQEMUCapsSet(virQEMUCapsPtr qemuCaps,
                     virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1);
 
-void virQEMUCapsSetVAList(virQEMUCapsPtr qemuCaps,
-                          va_list list) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 void virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) ATTRIBUTE_NONNULL(1);
 
 void virQEMUCapsClear(virQEMUCapsPtr qemuCaps,
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 6e7d1b0b9a..4d6e4b0d39 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -642,6 +642,7 @@ testInfoSetArgs(struct testInfo *info,
     char *capsarch = NULL;
     char *capsver = NULL;
     VIR_AUTOFREE(char *) capsfile = NULL;
+    int flag;
     int ret = -1;
 
     va_start(argptr, capslatest);
@@ -650,7 +651,10 @@ testInfoSetArgs(struct testInfo *info,
         case ARG_QEMU_CAPS:
             if (qemuCaps || !(qemuCaps = virQEMUCapsNew()))
                 goto cleanup;
-            virQEMUCapsSetVAList(qemuCaps, argptr);
+
+            while ((flag = va_arg(argptr, int)) < QEMU_CAPS_LAST)
+                virQEMUCapsSet(qemuCaps, flag);
+
             break;
 
         case ARG_GIC:
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 1/2] qemu_capabilities; Drop virQEMUCapsSetVAList
Posted by Daniel P. Berrangé 5 years, 8 months ago
On Wed, Mar 27, 2019 at 05:50:45PM +0100, Michal Privoznik wrote:
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/qemu/qemu_capabilities.c | 15 +++------------
>  src/qemu/qemu_capabilities.h |  2 --
>  tests/qemuxml2argvtest.c     |  6 +++++-
>  3 files changed, 8 insertions(+), 15 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list