[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/6] Use libuuid if available.
From: |
Gleb Natapov |
Subject: |
[Qemu-devel] [PATCH 4/6] Use libuuid if available. |
Date: |
Sun, 24 Aug 2008 14:33:19 +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 | 13 +++++++++++++
vl.c | 13 +++++++++++++
3 files changed, 30 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..2815ca5 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
@@ -779,6 +782,11 @@ EOF
fi
fi
+# uuid library
+if test "$uuid" = "yes" ; then
+ `pkg-config uuid 2> /dev/null` || uuid="no"
+fi
+
##########################################
# Sound support libraries probe
@@ -961,6 +969,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 +1177,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 e2b4042..532a03e 100644
--- a/vl.c
+++ b/vl.c
@@ -138,6 +138,11 @@ int inet_aton(const char *cp, struct in_addr *ia);
#include "exec-all.h"
+#ifdef CONFIG_UUID
+#include <uuid/uuid.h>
+static int uuid_dont_generate;
+#endif
+
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
#ifdef __sun__
@@ -8795,6 +8800,9 @@ int main(int argc, char **argv)
" Wrong format.\n");
exit(1);
}
+#ifdef CONFIG_UUID
+ uuid_dont_generate = 1;
+#endif
break;
case QEMU_OPTION_daemonize:
daemonize = 1;
@@ -8895,6 +8903,11 @@ int main(int argc, char **argv)
monitor_device = "stdio";
}
+#if CONFIG_UUID
+ if (!uuid_dont_generate)
+ uuid_generate(qemu_uuid);
+#endif
+
#ifndef _WIN32
if (daemonize) {
pid_t pid;
- [Qemu-devel] [PATCH 0/6] Add UUID command-line option, Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 1/6] Use IO port for qemu<->guest BIOS communication., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 2/6] Add -uuid command line option., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 3/6] Add "info uuid" command to monitor., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 4/6] Use libuuid if available.,
Gleb Natapov <=
- [Qemu-devel] [PATCH 5/6] Add UUID to BIOS configuration info., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 6/6] Pass cpu speed into SM BIOS., Gleb Natapov, 2008/08/24
- Re: [Qemu-devel] [PATCH 0/6] Add UUID command-line option, Blue Swirl, 2008/08/24