From: "Filip Navara" <xnavara@volny.cz>
To: qemu-devel@nongnu.org
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
Date: Tue, 11 Dec 2007 22:21:56 +0100 [thread overview]
Message-ID: <5b31733c0712111321j5640c446vebfedea0d3fe7531@mail.gmail.com> (raw)
In-Reply-To: <115f40a4994be1d5b44e.1197403732@localhost.localdomain>
[-- Attachment #1.1: Type: text/plain, Size: 5189 bytes --]
Hi Ryan & others,
now I have been holding a SMBIOS patch on my hard disk for way to long it
seems. I used a different approach from yours, so I decided to publish it
for review or further ideas. What I did was to modify the bochs bios to
produce the SMBIOS tables and I get the UUID using VMware backdoor port from
the virtual machine.
Attached are just the changed files, creating a patch will take a while
because it's against VERY OLD version of the sources.
Oh, it also contains ACPI patch for the processor descriptors which was
needed for some Windows versions and Darwin. Similar patch was used in KVM
before, but this one dynamically detects the number of CPUs.
Best regards,
Filip Navara
On Dec 11, 2007 9:08 PM, Ryan Harper <ryanh@us.ibm.com> wrote:
> 3 files changed, 38 insertions(+), 2 deletions(-)
> Makefile.target | 5 ++++-
> configure | 26 ++++++++++++++++++++++++++
> smbios.c | 9 ++++++++-
>
>
> # HG changeset patch
> # User Ryan Harper <ryanh@us.ibm.com>
> # Date 1197402122 21600
> # Node ID 115f40a4994be1d5b44ef193b3ccbe8e26410eef
> # Parent e81bef5fa072360d12b87b3237b7d3f72c9b9784
> Optionally link against libuuid if present.
>
> This patch makes libuuid optional. If not detected, SMBIOS tables will
> use
> canned UUID.
>
> Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
>
> diff -r e81bef5fa072 -r 115f40a4994b Makefile.target
> --- a/Makefile.target Tue Dec 11 13:42:01 2007 -0600
> +++ b/Makefile.target Tue Dec 11 13:42:02 2007 -0600
> @@ -402,6 +402,9 @@ VL_OBJS+=block-raw.o
>
> ifdef CONFIG_ALSA
> LIBS += -lasound
> +endif
> +ifdef CONFIG_UUID
> +LIBS += -luuid
> endif
> ifdef CONFIG_DSOUND
> LIBS += -lole32 -ldxguid
> @@ -535,7 +538,7 @@ ifndef CONFIG_DARWIN
> ifndef CONFIG_DARWIN
> ifndef CONFIG_WIN32
> ifndef CONFIG_SOLARIS
> -VL_LIBS+=-lutil -luuid
> +VL_LIBS+=-lutil
> endif
> endif
> endif
> diff -r e81bef5fa072 -r 115f40a4994b configure
> --- a/configure Tue Dec 11 13:42:01 2007 -0600
> +++ b/configure Tue Dec 11 13:42:02 2007 -0600
> @@ -89,6 +89,7 @@ dsound="no"
> dsound="no"
> coreaudio="no"
> alsa="no"
> +uuid="yes"
> fmod="no"
> fmod_lib=""
> fmod_inc=""
> @@ -260,6 +261,8 @@ for opt do
> ;;
> --enable-alsa) alsa="yes"
> ;;
> + --enable-uuid) uuid="yes"
> + ;;
> --enable-dsound) dsound="yes"
> ;;
> --enable-fmod) fmod="yes"
> @@ -404,6 +407,7 @@ echo " --enable-adlib enable
> echo " --enable-adlib enable Adlib emulation"
> echo " --enable-coreaudio enable Coreaudio audio driver"
> echo " --enable-alsa enable ALSA audio driver"
> +echo " --enable-uuid enable UUID generation for machines"
> echo " --enable-fmod enable FMOD audio driver"
> echo " --enable-dsound enable DirectSound audio driver"
> echo " --disable-vnc-tls disable TLS encryption for VNC server"
> @@ -662,6 +666,23 @@ EOF
> fi
> fi
>
> +##########################################
> +# uuid library
> +if test "$uuid" = "yes" ; then
> + 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
> + :
> + else
> + echo
> + echo "Error: Could not find uuid"
> + echo "Make sure to have the uuid libs and headers installed."
> + echo
> + exit 1
> + fi
> +fi
> # Check if tools are available to build documentation.
> if [ -x "`which texi2html 2>/dev/null`" ] && \
> [ -x "`which pod2man 2>/dev/null`" ]; then
> @@ -716,6 +737,7 @@ echo "Adlib support $adlib"
> echo "Adlib support $adlib"
> echo "CoreAudio support $coreaudio"
> echo "ALSA support $alsa"
> +echo "UUID support $uuid"
> echo "DSound support $dsound"
> if test "$fmod" = "yes"; then
> if test -z $fmod_lib || test -z $fmod_inc; then
> @@ -901,6 +923,10 @@ if test "$alsa" = "yes" ; then
> echo "CONFIG_ALSA=yes" >> $config_mak
> echo "#define CONFIG_ALSA 1" >> $config_h
> fi
> +if test "$uuid" = "yes" ; then
> + echo "CONFIG_UUID=yes" >> $config_mak
> + echo "#define CONFIG_UUID 1" >> $config_h
> +fi
> if test "$dsound" = "yes" ; then
> echo "CONFIG_DSOUND=yes" >> $config_mak
> echo "#define CONFIG_DSOUND 1" >> $config_h
> diff -r e81bef5fa072 -r 115f40a4994b smbios.c
> --- a/smbios.c Tue Dec 11 13:42:01 2007 -0600
> +++ b/smbios.c Tue Dec 11 13:42:02 2007 -0600
> @@ -25,11 +25,14 @@
> #include <stdio.h>
> #include <stdint.h>
> #include <string.h>
> -#include <uuid/uuid.h>
> #include "hw/hw.h"
> #include "sysemu.h"
> #include "smbios_types.h"
> #include "config-host.h"
> +
> +#ifdef CONFIG_UUID
> +#include <uuid/uuid.h>
> +#endif
>
> /* Write a two-character hex representation of 'byte' to digits[].
> Pre-condition: sizeof(digits) >= 2 */
> @@ -489,9 +492,13 @@ load_smbios_tables(uint8_t *entry, uint8
> int len;
> uint32_t major_version = 0;
> uint32_t minor_version = 9;
> +#ifdef CONFIG_UUID
> uuid_t uuid;
>
> uuid_generate(uuid);
> +#else
> + uint8_t uuid[16] = "QEMUQEMUQEMUQEMU";
> +#endif
>
> len = write_smbios_tables(entry, table, phys_table_start,
> smp_cpus, (ram_size >> 20),
>
>
>
[-- Attachment #1.2: Type: text/html, Size: 7316 bytes --]
[-- Attachment #2: rombios32.zip --]
[-- Type: application/zip, Size: 14024 bytes --]
next prev parent reply other threads:[~2007-12-11 21:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-11 20:08 [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 1 of 3] export SMBIOS/DMI tables to PC machines Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present Ryan Harper
2007-12-11 21:19 ` Filip Navara
2007-12-12 22:51 ` Fabrice Bellard
2008-01-03 19:55 ` Ryan Harper
2008-01-20 13:17 ` Filip Navara
2008-01-20 14:25 ` Paul Brook
2008-01-20 15:26 ` Filip Navara
2008-01-20 16:20 ` [kvm-devel] " Alexander Graf
2008-01-20 16:37 ` Filip Navara
2008-01-20 16:53 ` Alexander Graf
2008-01-20 17:01 ` Filip Navara
2007-12-11 21:21 ` Filip Navara [this message]
2007-12-11 20:08 ` [Qemu-devel] [PATCH 3 of 3] Add -uuid command line flag Ryan Harper
-- strict thread matches above, loose matches on Subject: below --
2007-12-07 20:45 [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
2007-12-07 20:45 ` [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present Ryan Harper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5b31733c0712111321j5640c446vebfedea0d3fe7531@mail.gmail.com \
--to=xnavara@volny.cz \
--cc=kvm-devel@lists.sourceforge.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).