Received: from eggs.gnu.org ([2001:4830:134:3::10]:40565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVKsb-0002n3-Sa for qemu-devel@nongnu.org; Thu, 04 Aug 2016 11:48:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVKsZ-0006Di-Pi for qemu-devel@nongnu.org; Thu, 04 Aug 2016 11:48:16 -0400 Date: Thu, 4 Aug 2016 16:48:02 +0100 From: "Daniel P. Berrange" Message-ID: <20160804154802.GD11318@redhat.com> Reply-To: "Daniel P. Berrange" References: <1470129518-21087-1-git-send-email-famz@redhat.com> <1470129518-21087-2-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1470129518-21087-2-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/7] util: Add UUID API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, kwolf@redhat.com, mreitz@redhat.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com, sw@weilnetz.de, qemu-block@nongnu.org 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 > --- > 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 :|