This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-unstable] xl: use libxl_domain_info to get the uuid

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: use libxl_domain_info to get the uuid in printf_info
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 09 Oct 2010 14:56:16 -0700
Delivery-date: Sat, 09 Oct 2010 15:05:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Andre Przywara <andre.przywara@xxxxxxx>
# Date 1285944166 -3600
# Node ID b89fa6d3f7540b52c57827c8036d5737f3eb0f3d
# Parent  c8331262efe61e33881ef6354a319ff6283e246d
xl: use libxl_domain_info to get the uuid in printf_info

If there is no UUID specified in the config file, we generate one during
the _parsing_ process. Since xl list -l parses the config file again,
the UUID will be generated again in this case and the reported
version does probably not match the used one.
Fix this by retrieving the UUID from dominfo (like xl list -v does).

Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
committer: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
 tools/libxl/xl_cmdimpl.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletion(-)

diff -r c8331262efe6 -r b89fa6d3f754 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Fri Oct 01 11:57:53 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Fri Oct 01 15:42:46 2010 +0100
@@ -469,6 +469,7 @@ static void printf_info(int domid,
                         libxl_device_model_info *dm_info)
     int i;
+    libxl_dominfo info;
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
@@ -480,7 +481,16 @@ static void printf_info(int domid,
     printf("\t(oos %d)\n", c_info->oos);
     printf("\t(ssidref %d)\n", c_info->ssidref);
     printf("\t(name %s)\n", c_info->name);
-    printf("\t(uuid " LIBXL_UUID_FMT ")\n", LIBXL_UUID_BYTES(c_info->uuid));
+    /* retrieve the UUID from dominfo, since it is probably generated
+     * during parsing and thus does not match the real one
+     */
+    if (libxl_domain_info(&ctx, &info, domid) == 0) {
+        printf("\t(uuid " LIBXL_UUID_FMT ")\n", LIBXL_UUID_BYTES(info.uuid));
+    } else {
+        printf("\t(uuid <unknown>)\n");
+    }
     printf("\t(cpupool %s (%d))\n", c_info->poolname, c_info->poolid);
     if (c_info->xsdata)
         printf("\t(xsdata contains data)\n");

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: use libxl_domain_info to get the uuid in printf_info, Xen patchbot-unstable <=