[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 1/7] util: Add UUID API
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-block] [PATCH 1/7] util: Add UUID API |
Date: |
Thu, 4 Aug 2016 16:48:02 +0100 |
User-agent: |
Mutt/1.6.2 (2016-07-01) |
On Tue, Aug 02, 2016 at 05:18:32PM +0800, Fam Zheng wrote:
> A number of different places across the code base use CONFIG_UUID. Some
> of them are soft dependency, some are not built if libuuid is not
> available, some come with dummy fallback, some throws runtime error.
>
> It is hard to maintain, and hard to reason for users.
>
> Since UUID is a simple standard with only a small number of operations,
> it is cleaner to have a central support in libqemuutil. This patch adds
> qemu_uuid_* the functions so that all uuid users in the code base can
> rely on. Except for qemu_uuid_generate which is new code, all other
> functions are just copy from existing fallbacks from other files.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> arch_init.c | 19 ---------------
> block/iscsi.c | 2 +-
> hw/smbios/smbios.c | 1 +
> include/qemu/uuid.h | 37 +++++++++++++++++++++++++++++
> include/sysemu/sysemu.h | 4 ----
> qmp.c | 1 +
> stubs/uuid.c | 2 +-
> util/Makefile.objs | 1 +
> util/uuid.c | 63
> +++++++++++++++++++++++++++++++++++++++++++++++++
> vl.c | 1 +
> 10 files changed, 106 insertions(+), 25 deletions(-)
> create mode 100644 include/qemu/uuid.h
> create mode 100644 util/uuid.c
It would be nice to see you add a tests/test-uuid.c unit test to
exercise all the new utility APIs you're adding & check their
corner cases.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
[Qemu-block] [PATCH 2/7] vhdx: Use QEMU UUID API, Fam Zheng, 2016/08/02
[Qemu-block] [PATCH 3/7] vdi: Use QEMU UUID API, Fam Zheng, 2016/08/02