Skip to contentSkip to conversation

Check availability of uuid header / lib

PATCH In review Stefan Weil 2 participants 4 messages Jul 3, 2009 – Jul 23, 2009 1 message not in the archive Kbuild

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Check availability of uuid header / lib

The Universally Unique Identifier library will be used for the new vdi block driver and maybe other parts of QEMU.

---
 Makefile        |    1 +
 Makefile.target |    2 ++
 configure       |   21 +++++++++++++++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)
Makefile +1 -0
index 66c28e5..ffa9c44 100644
@@ -33,6 +33,7 @@ else
 DOCS=
 endif
 
+LIBS+=$(UUID_LIBS)
 LIBS+=$(PTHREADLIBS)
 LIBS+=$(CLOCKLIBS)
 
Makefile.target +2 -0
index a593503..3b469e0 100644
@@ -541,6 +541,8 @@ ifdef CONFIG_BLUEZ
 LIBS += $(CONFIG_BLUEZ_LIBS)
 endif
 
+LIBS += $(UUID_LIBS)
+
 # xen backend driver support
 obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
 ifeq ($(CONFIG_XEN), yes)
configure +21 -0
index 73cc6b1..fc4c5b4 100755
@@ -972,6 +972,22 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
 fi
 
 ##########################################
+# uuid_generate() probe, used for vdi block driver
+uuid="no"
+cat > $TMPC << EOF
+#include <uuid/uuid.h>
+int main(void)
+{
+    uuid_t my_uuid;
+    uuid_generate(my_uuid);
+    return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC -luuid >/dev/null 2>&1; then
+   uuid="yes"
+fi
+
+##########################################
 # vde libraries probe
 if test "$vde" = "yes" ; then
   cat > $TMPC << EOF
@@ -1453,6 +1469,7 @@ echo "Install blobs     $blobs"
 echo -e "KVM support       $kvm"
 echo "fdt support       $fdt"
 echo "preadv support    $preadv"
+echo "uuid support      $uuid"
 
 if test $sdl_too_old = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -1697,6 +1714,10 @@ fi
 if test "$fnmatch" = "yes" ; then
   echo "#define HAVE_FNMATCH_H 1" >> $config_h
 fi
+if test "$uuid" = "yes" ; then
+  echo "#define HAVE_UUID_H 1" >> $config_h
+  echo "UUID_LIBS=-luuid" >> $config_mak
+fi
 qemu_version=`head $source_path/VERSION`
 echo "VERSION=$qemu_version" >>$config_mak
 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
Signature · 1 line
1.5.6.5
#2 lore raw
Quoted 9 lines · Stefan Weil

The Universally Unique Identifier library will be used for the new vdi block driver and maybe other parts of QEMU.

---
Makefile | 1 +
Makefile.target | 2 ++
configure | 21 +++++++++++++++++++++

3 files changed, 24 insertions(+), 0 deletions(-)

...

That patch no longer applies without merge conflicts.

I just noticed that there was a discussion a year ago when other developers suggested to use libuuid.

We can see the result of that discussion in the current code:
QEMU does not use libuuid, not even functions with the same interface. Nor does it include a function to generate a new UUID value.

There were arguments why QEMU would not need UUID generation in its code. The VDI block driver needs UUID generation unless we are satisfied with dummy or zero values.

My personal preference is using libuuid and the functions included. For systems without libuuid, a minimalistic implementation could be provided.

Before I send an update of my patch, I'd like to hear the opinion of others, especially of the QEMU maintainers.

Regards,
Stefan Weil

#3 lore raw
Quoted 10 lines · Stefan Weil

That patch no longer applies without merge conflicts.

I just noticed that there was a discussion a year ago when other developers suggested to use libuuid.

We can see the result of that discussion in the current code:
QEMU does not use libuuid, not even functions with the same interface. Nor does it include a function to generate a new UUID value.

Quoted 5 lines

There were arguments why QEMU would not need UUID generation in its code. The VDI block driver needs UUID generation unless we are satisfied with dummy or zero values.

I don't mind linking against libuuid.

However, I think the VDI block driver has to support AIO before it can be merged into the tree.

Regards,

Anthony Liguori

#4 lore raw
Quoted 17 lines · Anthony Liguori
Quoted 10 lines · Stefan Weil

That patch no longer applies without merge conflicts.

I just noticed that there was a discussion a year ago when other developers suggested to use libuuid.

We can see the result of that discussion in the current code:
QEMU does not use libuuid, not even functions with the same interface. Nor does it include a function to generate a new UUID value.

Quoted 5 lines

There were arguments why QEMU would not need UUID generation in its code. The VDI block driver needs UUID generation unless we are satisfied with dummy or zero values.

Quoted 9 lines

I don't mind linking against libuuid.

However, I think the VDI block driver has to support AIO before it can be merged into the tree.

Regards,

Anthony Liguori

AIO code is available now. See separate mail.

Regards,

Stefan Weil