[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 4/6] Use libuuid if available.
From: |
Gleb Natapov |
Subject: |
[Qemu-devel] [PATCH v2 4/6] Use libuuid if available. |
Date: |
Mon, 25 Aug 2008 12:58:20 +0300 |
User-agent: |
StGIT/0.14.2 |
If libuuid is available use it for UUID generation in case a user does not
provide one.
Signed-off-by: Gleb Natapov <address@hidden>
---
Makefile.target | 4 ++++
configure | 21 +++++++++++++++++++++
vl.c | 13 +++++++++++++
3 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index 2464484..54defd9 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -518,6 +518,10 @@ CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
LIBS += $(CONFIG_VNC_TLS_LIBS)
endif
+ifdef CONFIG_UUID
+LIBS += -luuid
+endif
+
# SCSI layer
OBJS+= lsi53c895a.o esp.o
diff --git a/configure b/configure
index acb4a4a..fa46a64 100755
--- a/configure
+++ b/configure
@@ -110,6 +110,7 @@ curses="yes"
aio="yes"
nptl="yes"
mixemu="no"
+uuid="yes"
# OS specific
targetos=`uname -s`
@@ -316,6 +317,8 @@ for opt do
;;
--enable-uname-release=*) uname_release="$optarg"
;;
+ --disable-uuid) uuid="no"
+ ;;
--sparc_cpu=*)
sparc_cpu="$optarg"
case $sparc_cpu in
@@ -780,6 +783,19 @@ EOF
fi
##########################################
+# uuid library
+if test "$uuid" = "yes" ; then
+ uuid=no
+ cat > $TMPC << EOF
+#include <uuid/uuid.h>
+int main(void) { uuid_t u; return 0; }
+EOF
+ if $cc -o $TMPE $TMPC -luuid 2> /dev/null ; then
+ uuid=yes
+ fi
+fi
+
+##########################################
# Sound support libraries probe
audio_drv_probe()
@@ -961,6 +977,7 @@ echo "uname -r $uname_release"
echo "NPTL support $nptl"
echo "vde support $vde"
echo "AIO support $aio"
+echo "UUID support $uuid"
if test $sdl_too_old = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -1168,6 +1185,10 @@ if test "$vnc_tls" = "yes" ; then
echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
echo "#define CONFIG_VNC_TLS 1" >> $config_h
fi
+if test "$uuid" = "yes" ; then
+ echo "CONFIG_UUID=yes" >> $config_mak
+ echo "#define CONFIG_UUID 1" >> $config_h
+fi
qemu_version=`head $source_path/VERSION`
echo "VERSION=$qemu_version" >>$config_mak
echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
diff --git a/vl.c b/vl.c
index 30fef2a..ea240d8 100644
--- a/vl.c
+++ b/vl.c
@@ -142,6 +142,11 @@ int inet_aton(const char *cp, struct in_addr *ia);
#include "exec-all.h"
+#ifdef CONFIG_UUID
+#include <uuid/uuid.h>
+static int generate_uuid = 1;
+#endif
+
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
#ifdef __sun__
@@ -8808,6 +8813,9 @@ int main(int argc, char **argv)
" Wrong format.\n");
exit(1);
}
+#ifdef CONFIG_UUID
+ generate_uuid = 0;
+#endif
break;
case QEMU_OPTION_daemonize:
daemonize = 1;
@@ -8908,6 +8916,11 @@ int main(int argc, char **argv)
monitor_device = "stdio";
}
+#if CONFIG_UUID
+ if (generate_uuid)
+ uuid_generate(qemu_uuid);
+#endif
+
#ifndef _WIN32
if (daemonize) {
pid_t pid;
- Re: [Qemu-devel] [PATCH v2 1/6] Use IO port for qemu<->guest BIOS communication., (continued)
Re: [Qemu-devel] [PATCH v2 1/6] Use IO port for qemu<->guest BIOS communication., Anthony Liguori, 2008/08/25
[Qemu-devel] [PATCH v2 2/6] Add -uuid command line option., Gleb Natapov, 2008/08/25
[Qemu-devel] [PATCH v2 3/6] Add "info uuid" command to monitor., Gleb Natapov, 2008/08/25
[Qemu-devel] [PATCH v2 5/6] Add UUID to BIOS configuration info., Gleb Natapov, 2008/08/25
[Qemu-devel] [PATCH v2 4/6] Use libuuid if available.,
Gleb Natapov <=
- Re: [Qemu-devel] [PATCH v2 4/6] Use libuuid if available., Andreas Färber, 2008/08/25
- Re: [Qemu-devel] [PATCH v2 4/6] Use libuuid if available., Gleb Natapov, 2008/08/25
- Re: [Qemu-devel] [PATCH v2 4/6] Use libuuid if available., Jamie Lokier, 2008/08/25
- Re: [Qemu-devel] [PATCH v2 4/6] Use libuuid if available., Andreas Färber, 2008/08/25
- Re: [Qemu-devel] [PATCH v2 4/6] Use libuuid if available., Gleb Natapov, 2008/08/25
- [Qemu-devel] Re: [PATCH v2 4/6] Use libuuid if available., Sebastian Herbszt, 2008/08/25
[Qemu-devel] [PATCH v2 6/6] Pass cpu speed into SM BIOS., Gleb Natapov, 2008/08/25