Re: [PATCH v2 7/7] tests: Use virBitmap for qemu command line caps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/22/2011 09:48 AM, Jiri Denemark wrote:
> This needs to be squashed into the previous patch but is provided
> separately for easier review.
> 
> ---
> Notes:
>     Version 2:
>     - rebased to current master
> 
>  src/qemu/qemu_capabilities.c |   14 +
>  src/qemu/qemu_capabilities.h |    2 +
>  tests/qemuhelptest.c         |  729 +++++++++++++++++++++---------------------
>  tests/qemuxml2argvtest.c     |  470 ++++++++++++++--------------
>  4 files changed, 619 insertions(+), 596 deletions(-)

Agree that this should be squashed in with the previous patch, but the
separation did make for a nicer review.

> +static void printMismatchedFlags(virBitmapPtr got,
> +                                 virBitmapPtr expect)
>  {
>      int i;
>  
> -    for (i = 0 ; i < (sizeof(got)*CHAR_BIT) ; i++) {
> -        unsigned long long gotFlag = (got & (1LL << i));
> -        unsigned long long expectFlag = (expect & (1LL << i));
> +    for (i = 0 ; i < QEMU_CAPS_LAST ; i++) {
> +        bool gotFlag = qemuCapsGet(got, i);
> +        bool expectFlag = qemuCapsGet(expect, i);
>          if (gotFlag && !expectFlag)
>              fprintf(stderr, "Extra flag %i\n", i);

Hmm - debugging this will now be slightly harder.  Before, "extra flag
37" meant looking for (1LL << 37) in qemu_capabilities.h, but now we
need to count 37 lines.  Perhaps you should amend the change in
qemu_capabilities.h to preserve the integer numbering of each capability:

+    QEMU_CAPS_KQEMU = 0,          /* Whether KQEMU is compiled in */
+    QEMU_CAPS_VNC_COLON = 1,      /* Does the VNC take just port, or
address + display */

ACK with that nit fixed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]