debuggers.hg

changeset 22262:b89fa6d3f754

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@amd.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Andre Przywara <andre.przywara@amd.com>
date Fri Oct 01 15:42:46 2010 +0100 (2010-10-01)
parents c8331262efe6
children 27c01a2e2a47
files tools/libxl/xl_cmdimpl.c
line diff
     1.1 --- a/tools/libxl/xl_cmdimpl.c	Fri Oct 01 11:57:53 2010 +0100
     1.2 +++ b/tools/libxl/xl_cmdimpl.c	Fri Oct 01 15:42:46 2010 +0100
     1.3 @@ -469,6 +469,7 @@ static void printf_info(int domid,
     1.4                          libxl_device_model_info *dm_info)
     1.5  {
     1.6      int i;
     1.7 +    libxl_dominfo info;
     1.8  
     1.9      libxl_domain_create_info *c_info = &d_config->c_info;
    1.10      libxl_domain_build_info *b_info = &d_config->b_info;
    1.11 @@ -480,7 +481,16 @@ static void printf_info(int domid,
    1.12      printf("\t(oos %d)\n", c_info->oos);
    1.13      printf("\t(ssidref %d)\n", c_info->ssidref);
    1.14      printf("\t(name %s)\n", c_info->name);
    1.15 -    printf("\t(uuid " LIBXL_UUID_FMT ")\n", LIBXL_UUID_BYTES(c_info->uuid));
    1.16 +
    1.17 +    /* retrieve the UUID from dominfo, since it is probably generated
    1.18 +     * during parsing and thus does not match the real one
    1.19 +     */
    1.20 +    if (libxl_domain_info(&ctx, &info, domid) == 0) {
    1.21 +        printf("\t(uuid " LIBXL_UUID_FMT ")\n", LIBXL_UUID_BYTES(info.uuid));
    1.22 +    } else {
    1.23 +        printf("\t(uuid <unknown>)\n");
    1.24 +    }
    1.25 +
    1.26      printf("\t(cpupool %s (%d))\n", c_info->poolname, c_info->poolid);
    1.27      if (c_info->xsdata)
    1.28          printf("\t(xsdata contains data)\n");