From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVanj-0007jT-Pq for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:48:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVanh-0007cI-QW for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:48:18 -0400 Date: Fri, 5 Aug 2016 16:48:10 +0800 From: Fam Zheng Message-ID: <20160805084810.GD8458@ad.usersys.redhat.com> References: <1470129518-21087-1-git-send-email-famz@redhat.com> <1470129518-21087-2-git-send-email-famz@redhat.com> <20160804154802.GD11318@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160804154802.GD11318@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: "Daniel P. Berrange" 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 Thu, 08/04 16:48, Daniel P. Berrange wrote: > 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. Sure, I'll add a test case. Fam