diff mbox series

[01/21] qemu: add virQEMUCapsSetVList

Message ID 5b3efbd783559ee6241167a7913943db2d4fbc0d.1552574299.git.crobinso@redhat.com
State Accepted
Commit 05be8d8b06c0d1dc9e94ad466b05a6db75e1cb14
Headers show
Series tests: qemuxml2argv: support optional arguments | expand

Commit Message

Cole Robinson March 14, 2019, 2:43 p.m. UTC
It will be used in future patches

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 src/qemu/qemu_capabilities.c | 14 +++++++++++---
 src/qemu/qemu_capabilities.h |  2 ++
 2 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.20.1

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

Comments

Andrea Bolognani March 19, 2019, 9:51 a.m. UTC | #1
On Thu, 2019-03-14 at 10:43 -0400, Cole Robinson wrote:
> It will be used in future patches


You're actually changing the existing virQEMUCapsSetList() to use
it... I'd point that out in the commit message. You can still
mention the fact that you're going to add more users later on.

[...]
>  void

> +virQEMUCapsSetVList(virQEMUCapsPtr qemuCaps, va_list list)


I'd call this virQEMUCapsSetVAList(), given the type of the second
argument; the existing virCommandNewVAList() already uses this naming
scheme.

The second argument should be on a separate line.


Everything else looks good, so

  Reviewed-by: Andrea Bolognani <abologna@redhat.com>


-- 
Andrea Bolognani / Red Hat / Virtualization

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

Patch

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 4c8229fbda..a274ce7992 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1664,14 +1664,22 @@  virQEMUCapsSet(virQEMUCapsPtr qemuCaps,
 
 
 void
-virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...)
+virQEMUCapsSetVList(virQEMUCapsPtr qemuCaps, va_list list)
 {
-    va_list list;
     int flag;
 
-    va_start(list, qemuCaps);
     while ((flag = va_arg(list, int)) < QEMU_CAPS_LAST)
         ignore_value(virBitmapSetBit(qemuCaps->flags, flag));
+}
+
+
+void
+virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...)
+{
+    va_list list;
+
+    va_start(list, qemuCaps);
+    virQEMUCapsSetVList(qemuCaps, list);
     va_end(list);
 }
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 06c7606e2f..3601207989 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -518,6 +518,8 @@  virQEMUCapsPtr virQEMUCapsNew(void);
 void virQEMUCapsSet(virQEMUCapsPtr qemuCaps,
                     virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1);
 
+void virQEMUCapsSetVList(virQEMUCapsPtr qemuCaps,
+                         va_list list) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 void virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) ATTRIBUTE_NONNULL(1);
 
 void virQEMUCapsClear(virQEMUCapsPtr qemuCaps,