From patchwork Thu Oct 1 18:10:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 34758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 40CD0B7BC9 for ; Fri, 2 Oct 2009 04:11:28 +1000 (EST) Received: from localhost ([127.0.0.1]:48458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtQ7h-0006d8-Bl for incoming@patchwork.ozlabs.org; Thu, 01 Oct 2009 14:11:25 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtQ7E-0006d0-97 for qemu-devel@nongnu.org; Thu, 01 Oct 2009 14:10:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtQ79-0006ZK-Rc for qemu-devel@nongnu.org; Thu, 01 Oct 2009 14:10:55 -0400 Received: from [199.232.76.173] (port=44795 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtQ79-0006ZF-6C for qemu-devel@nongnu.org; Thu, 01 Oct 2009 14:10:51 -0400 Received: from mx20.gnu.org ([199.232.41.8]:65186) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtQ78-0002a6-PU for qemu-devel@nongnu.org; Thu, 01 Oct 2009 14:10:50 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtQ76-0004dy-7g for qemu-devel@nongnu.org; Thu, 01 Oct 2009 14:10:48 -0400 Received: from flocke.weilnetz.de (p54ADF9AE.dip.t-dialin.net [84.173.249.174]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LtlI5-1MAMXq2T25-011Dm3; Thu, 01 Oct 2009 20:10:40 +0200 Received: from stefan by flocke.weilnetz.de with local (Exim 4.69) (envelope-from ) id 1MtQ6w-0005z5-2a; Thu, 01 Oct 2009 20:10:38 +0200 From: Stefan Weil To: QEMU Developers Date: Thu, 1 Oct 2009 20:10:37 +0200 Message-Id: <1254420637-21483-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1248380874-7298-1-git-send-email-weil@mail.berlios.de> References: <1248380874-7298-1-git-send-email-weil@mail.berlios.de> X-Provags-ID: V01U2FsdGVkX18VRFLTfeD/DggEGJ1YMybbA3DU+wgcv7lGvTQ 6cj3sQN+PzEss9mSQpPsY8Qh58xsh5YxWVIuxUoLDG1d3dKpft o8yf4JC8GF7JNHLoNXMJORveTjzcYAW64Lg8cF1iB7mo01I6K4 dcA== X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Subject: [Qemu-devel] [PATCH] Check availability of uuid header / library X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If available, the Universally Unique Identifier library is used by the vdi block driver. Other parts of QEMU (vl.c) could also use it. This is an updated version of my previous patch with changes needed by the current QEMU configuration standard. Signed-off-by: Stefan Weil --- block/vdi.c | 4 ++-- configure | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index f5e38db..45aa81c 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -53,7 +53,7 @@ #include "block_int.h" #include "module.h" -#if defined(HAVE_UUID_H) +#if defined(CONFIG_UUID) #include #else /* TODO: move uuid emulation to some central place in QEMU. */ @@ -116,7 +116,7 @@ void uuid_unparse(const uuid_t uu, char *out); /* Unallocated blocks use this index (no need to convert endianess). */ #define VDI_UNALLOCATED UINT32_MAX -#if !defined(HAVE_UUID_H) +#if !defined(CONFIG_UUID) void uuid_generate(uuid_t out) { memset(out, 0, sizeof(out)); diff --git a/configure b/configure index fb5b6bb..33521d1 100755 --- a/configure +++ b/configure @@ -187,6 +187,7 @@ kvm="" nptl="" sdl="" sparse="no" +uuid="" vde="" vnc_tls="" vnc_sasl="" @@ -451,6 +452,10 @@ for opt do ;; --disable-slirp) slirp="no" ;; + --disable-uuid) uuid="no" + ;; + --enable-uuid) uuid="yes" + ;; --disable-vde) vde="no" ;; --enable-vde) vde="yes" @@ -695,6 +700,8 @@ echo " --fmod-inc path to FMOD includes" echo " --oss-lib path to OSS library" echo " --enable-uname-release=R Return R for uname -r in usermode emulation" echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" +echo " --disable-uuid disable uuid support" +echo " --enable-uuid enable uuid support" echo " --disable-vde disable support for vde network" echo " --enable-vde enable support for vde network" echo " --disable-linux-aio disable Linux AIO support" @@ -1047,6 +1054,31 @@ if compile_prog "" "" ; then fi ########################################## +# uuid_generate() probe, used for vdi block driver +if test "$uuid" != "no" ; then + uuid_libs="-luuid" + cat > $TMPC << EOF +#include +int main(void) +{ + uuid_t my_uuid; + uuid_generate(my_uuid); + return 0; +} +EOF + if compile_prog "" "$uuid_libs" ; then + uuid="yes" + libs_softmmu="$uuid_libs $libs_softmmu" + libs_tools="$uuid_libs $libs_tools" + else + if test "$uuid" = "yes" ; then + feature_not_found "uuid" + fi + uuid=no + fi +fi + +########################################## # vde libraries probe if test "$vde" != "no" ; then vde_libs="-lvdeplug" @@ -1751,6 +1783,7 @@ echo "KVM support $kvm" echo "fdt support $fdt" echo "preadv support $preadv" echo "fdatasync $fdatasync" +echo "uuid support $uuid" if test $sdl_too_old = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -1861,6 +1894,9 @@ fi if test "$fnmatch" = "yes" ; then echo "CONFIG_FNMATCH=y" >> $config_host_mak fi +if test "$uuid" = "yes" ; then + echo "CONFIG_UUID=y" >> $config_host_mak +fi qemu_version=`head $source_path/VERSION` echo "VERSION=$qemu_version" >>$config_host_mak echo "PKGVERSION=$pkgversion" >>$config_host_mak