xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	edvin.torok@citrix.com, Sergey Dyasli <sergey.dyasli@citrix.com>
Subject: [PATCH 2/3] tools/helpers: make gen_stub_json_config accept an UUID argument
Date: Wed, 14 Nov 2018 18:17:31 +0000	[thread overview]
Message-ID: <20181114181732.19013-3-wei.liu2@citrix.com> (raw)
In-Reply-To: <20181114181732.19013-1-wei.liu2@citrix.com>

If that's set, the stub is going to contain that UUID.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/helpers/init-dom-json.c        | 5 ++++-
 tools/helpers/init-dom-json.h        | 3 ++-
 tools/helpers/init-xenstore-domain.c | 2 +-
 tools/helpers/xen-init-dom0.c        | 2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/helpers/init-dom-json.c b/tools/helpers/init-dom-json.c
index 704e7cb4f0..9514b3ceb6 100644
--- a/tools/helpers/init-dom-json.c
+++ b/tools/helpers/init-dom-json.c
@@ -7,7 +7,7 @@
 #include <xenctrl.h>
 #include <libxl.h>
 
-int gen_stub_json_config(uint32_t domid)
+int gen_stub_json_config(uint32_t domid, libxl_uuid *uuid)
 {
     int rc = 1;
     xentoollog_logger_stdiostream *logger;
@@ -40,6 +40,9 @@ int gen_stub_json_config(uint32_t domid)
     libxl_domain_build_info_init_type(&dom_config.b_info,
                                       dom_config.c_info.type);
 
+    if (uuid && !libxl_uuid_is_nil(uuid))
+        libxl_uuid_copy(ctx, &dom_config.c_info.uuid, uuid);
+
     json = libxl_domain_config_to_json(ctx, &dom_config);
     /* libxl-json format requires the string ends with '\0'. Code
      * snippet taken from libxl.
diff --git a/tools/helpers/init-dom-json.h b/tools/helpers/init-dom-json.h
index 58c85df157..5be88f6638 100644
--- a/tools/helpers/init-dom-json.h
+++ b/tools/helpers/init-dom-json.h
@@ -1,10 +1,11 @@
 #ifndef __INIT_DOM_JSON_H
 #define __INIT_DOM_JSON_H
 
+#include <libxl.h>
 /*
  * Generate a stub JSON config for a domain with the given domid.
  */
-int gen_stub_json_config(uint32_t domid);
+int gen_stub_json_config(uint32_t domid, libxl_uuid *uuid);
 
 #endif
 /*
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 3236d14416..adb8408b63 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -382,7 +382,7 @@ int main(int argc, char** argv)
     if ( rv )
         return 1;
 
-    rv = gen_stub_json_config(domid);
+    rv = gen_stub_json_config(domid, NULL);
     if ( rv )
         return 3;
 
diff --git a/tools/helpers/xen-init-dom0.c b/tools/helpers/xen-init-dom0.c
index 9ab8468bdb..09bc0027f9 100644
--- a/tools/helpers/xen-init-dom0.c
+++ b/tools/helpers/xen-init-dom0.c
@@ -31,7 +31,7 @@ int main(int argc, char **argv)
         goto out;
     }
 
-    rc = gen_stub_json_config(0);
+    rc = gen_stub_json_config(0, NULL);
     if (rc)
         goto out;
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-11-14 18:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 18:17 [PATCH 0/3] Provide mechanism to set UUID for Dom0 Wei Liu
2018-11-14 18:17 ` [PATCH 1/3] tools: update examples/README Wei Liu
2018-11-15 14:28   ` Andrew Cooper
2018-11-15 14:32     ` Wei Liu
2018-11-20 14:25   ` Ian Jackson
2018-11-14 18:17 ` Wei Liu [this message]
2018-11-15 14:42   ` [PATCH 2/3] tools/helpers: make gen_stub_json_config accept an UUID argument Andrew Cooper
2018-11-20 14:24   ` Ian Jackson
2018-11-14 18:17 ` [PATCH 3/3] xen-init-dom0: set Dom0 UUID if requested Wei Liu
2018-11-14 20:16   ` Jason Andryuk
2018-11-14 20:44     ` Wei Liu
2018-11-15 10:45   ` Edwin Török
2018-11-15 11:20     ` Wei Liu
2018-11-15 13:35       ` Wei Liu
2018-11-15 13:36         ` Andrew Cooper
2018-11-15 14:30   ` [PATCH v2 " Wei Liu
2018-11-15 15:14     ` Edwin Török
2018-11-20 14:28   ` [PATCH " Ian Jackson

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=20181114181732.19013-3-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=edvin.torok@citrix.com \
    --cc=sergey.dyasli@citrix.com \
    --cc=xen-devel@lists.xenproject.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).