From: Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
To: Ryan Harper <ryanh-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 3 of 3] Add -uuid command line flag
Date: Fri, 07 Dec 2007 14:52:10 -0600 [thread overview]
Message-ID: <4759B27A.4060008@codemonkey.ws> (raw)
In-Reply-To: <5fe703a5a7bde701686f.1197059817-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
Ryan Harper wrote:
> 2 files changed, 29 insertions(+), 1 deletion(-)
> smbios.c | 12 +++++++++++-
> vl.c | 18 ++++++++++++++++++
>
>
> # HG changeset patch
> # User Ryan Harper <ryanh-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> # Date 1197058922 21600
> # Node ID 5fe703a5a7bde701686fc333c17836b308c17b4f
> # Parent 3470dd05f46cc9f14c3fc9561d06031a4bc0ce7a
> Add -uuid command line flag
>
> This patch allows users to specify a uuid. If no uuid is specified, then one is
> generated.
>
> Signed-off-by: Ryan Harper <ryanh-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>
> diff -r 3470dd05f46c -r 5fe703a5a7bd smbios.c
> --- a/smbios.c Fri Dec 07 14:22:02 2007 -0600
> +++ b/smbios.c Fri Dec 07 14:22:02 2007 -0600
> @@ -32,6 +32,7 @@
>
> #ifdef CONFIG_UUID
> #include <uuid/uuid.h>
> +extern const char *qemu_uuid;
> #endif
>
Please move this to a header.
> CPUState *first_cpu;
> @@ -497,7 +498,16 @@ load_smbios_tables(uint8_t *entry, uint8
> #ifdef CONFIG_UUID
> uuid_t uuid;
>
> - uuid_generate(uuid);
> + /* parse user-specified uuid if present */
> + if (qemu_uuid != NULL) {
> + if (uuid_parse(qemu_uuid, uuid) < 0) {
> + fprintf(stderr, "SMBIOS: Could not parse user UUID"
> + "string, check format.\n");
> + return -1;
> + }
> + } else {
> + uuid_generate(uuid);
> + }
> #else
> uint8_t uuid[16] = "QEMUQEMUQEMUQEMU";
>
I think it's worth writing a uuid_parse() for use in the absence of
-luuid. You can just use sscanf(). That will get rid of a lot of
CONFIG_UUIDs too.
Regards,
Anthony Liguori
> #endif
> diff -r 3470dd05f46c -r 5fe703a5a7bd vl.c
> --- a/vl.c Fri Dec 07 14:22:02 2007 -0600
> +++ b/vl.c Fri Dec 07 14:22:02 2007 -0600
> @@ -137,6 +137,9 @@ int inet_aton(const char *cp, struct in_
> #define SMBD_COMMAND "/usr/sfw/sbin/smbd"
> #else
> #define SMBD_COMMAND "/usr/sbin/smbd"
> +#endif
> +#ifdef CONFIG_UUID
> +const char *qemu_uuid;
> #endif
>
> //#define DEBUG_UNUSED_IOPORT
> @@ -7545,6 +7548,10 @@ static void help(int exitcode)
> "-no-reboot exit instead of rebooting\n"
> "-loadvm file start right away with a saved state (loadvm in monitor)\n"
> "-vnc display start a VNC server on display\n"
> +#ifdef CONFIG_UUID
> + "-uuid %%08x-%%04x-%%04x-%%04x-%%012x\n"
> + " specify machine UUID\n"
> +#endif
> #ifndef _WIN32
> "-daemonize daemonize QEMU after initializing\n"
> #endif
> @@ -7647,6 +7654,9 @@ enum {
> QEMU_OPTION_vnc,
> QEMU_OPTION_no_acpi,
> QEMU_OPTION_no_reboot,
> +#ifdef CONFIG_UUID
> + QEMU_OPTION_uuid,
> +#endif
> QEMU_OPTION_show_cursor,
> QEMU_OPTION_daemonize,
> QEMU_OPTION_option_rom,
> @@ -7742,6 +7752,9 @@ const QEMUOption qemu_options[] = {
> { "usbdevice", HAS_ARG, QEMU_OPTION_usbdevice },
> { "smp", HAS_ARG, QEMU_OPTION_smp },
> { "vnc", HAS_ARG, QEMU_OPTION_vnc },
> +#ifdef CONFIG_UUID
> + { "uuid", HAS_ARG, QEMU_OPTION_uuid },
> +#endif
>
> /* temporary options */
> { "usb", 0, QEMU_OPTION_usb },
> @@ -8527,6 +8540,11 @@ int main(int argc, char **argv)
> case QEMU_OPTION_daemonize:
> daemonize = 1;
> break;
> +#ifdef CONFIG_UUID
> + case QEMU_OPTION_uuid:
> + qemu_uuid = optarg;
> + break;
> +#endif
> case QEMU_OPTION_option_rom:
> if (nb_option_roms >= MAX_OPTION_ROMS) {
> fprintf(stderr, "Too many option ROMs\n");
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
>
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
next prev parent reply other threads:[~2007-12-07 20:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-07 20:36 [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
[not found] ` <patchbomb.1197059814-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-12-07 20:36 ` [PATCH 1 of 3] export SMBIOS/DMI tables to PC machines Ryan Harper
[not found] ` <37bf559ffcf74bfe62ec.1197059815-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-12-07 20:48 ` Anthony Liguori
[not found] ` <4759B1A9.5080302-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-12-07 20:52 ` Ryan Harper
[not found] ` <20071207205250.GF23913-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-12-07 21:04 ` Anthony Liguori
[not found] ` <4759B559.1070405-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-12-07 21:13 ` [Qemu-devel] " Ryan Harper
[not found] ` <20071207211318.GG23913-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-12-07 21:24 ` Anthony Liguori
2007-12-07 20:36 ` [PATCH 2 of 3] Optionally link against libuuid if present Ryan Harper
2007-12-07 20:36 ` [PATCH 3 of 3] Add -uuid command line flag Ryan Harper
[not found] ` <5fe703a5a7bde701686f.1197059817-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-12-07 20:52 ` Anthony Liguori [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-12-11 20:08 [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
[not found] ` <patchbomb.1197403730-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-12-11 20:08 ` [PATCH 3 of 3] Add -uuid command line flag 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=4759B27A.4060008@codemonkey.ws \
--to=anthony-rdkfgonbjusknkdkm+me6a@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org \
--cc=ryanh-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.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