qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/5] Add -uuid command line option.


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 2/5] Add -uuid command line option.
Date: Thu, 05 Jun 2008 10:13:24 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Gleb Natapov wrote:
Let user specify UUID of the virtual machine.

Looks good to me. Note, this is a very common feature request for management tools running agents within a guest. They need to have a unique identifier to be able to correlate guests with hosts. Normally, this would be exposed via DMI tables but that's an obvious extension.

Reviewed-by: Anthony Liguori <address@hidden>

Regards,

Anthony Liguori

Signed-off-by: Gleb Natapov <address@hidden>
---

 vl.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/vl.c b/vl.c
index 18ddcce..8e9e841 100644
--- a/vl.c
+++ b/vl.c
@@ -240,6 +240,8 @@ static CPUState *cur_cpu;
 static CPUState *next_cpu;
 static int event_pending = 1;
+const char *qemu_uuid_str;
+
 #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
/***********************************************************/
@@ -7195,6 +7197,7 @@ static void help(int exitcode)
            "-g WxH[xDEPTH]  Set the initial graphical resolution and depth\n"
 #endif
            "-name string    set the name of the guest\n"
+           "-uuid %%08x-%%04x-%%04x-%%04x-%%012x specify machine UUID\n"
            "\n"
            "Network options:\n"
            "-net nic[,vlan=n][,macaddr=addr][,model=type]\n"
@@ -7379,6 +7382,7 @@ enum {
     QEMU_OPTION_clock,
     QEMU_OPTION_startdate,
     QEMU_OPTION_tb_size,
+    QEMU_OPTION_uuid,
 };
typedef struct QEMUOption {
@@ -7467,6 +7471,7 @@ const QEMUOption qemu_options[] = {
 #ifdef CONFIG_CURSES
     { "curses", 0, QEMU_OPTION_curses },
 #endif
+    { "uuid", HAS_ARG, QEMU_OPTION_uuid },
/* temporary options */
     { "usb", 0, QEMU_OPTION_usb },
@@ -8227,6 +8232,9 @@ int main(int argc, char **argv)
             case QEMU_OPTION_show_cursor:
                 cursor_hide = 0;
                 break;
+            case QEMU_OPTION_uuid:
+                qemu_uuid_str = optarg;
+                break;
            case QEMU_OPTION_daemonize:
                daemonize = 1;
                break;








reply via email to

[Prev in Thread] Current Thread [Next in Thread]