Message ID | 5b3efbd783559ee6241167a7913943db2d4fbc0d.1552574299.git.crobinso@redhat.com |
---|---|
State | Accepted |
Commit | 05be8d8b06c0d1dc9e94ad466b05a6db75e1cb14 |
Headers | show |
Series | tests: qemuxml2argv: support optional arguments | expand |
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 --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,
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