]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
libxl: modify libxl__logv() to only log valid domid values
authorPaul Durrant <pdurrant@amazon.com>
Fri, 21 Feb 2020 11:20:45 +0000 (11:20 +0000)
committerWei Liu <wl@xen.org>
Fri, 21 Feb 2020 12:05:41 +0000 (12:05 +0000)
Some code-paths use values other than INVALID_DOMID to indicate an invalid
domain id. Specifically, xl will pass a value of 0 when creating/restoring
a domain. Therefore modify libxl__logv() to use libxl_domid_valid_guest()
as a validity test.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libxl/libxl_internal.c

index 211236dc991d163f882bb570c30345d3da7b94fa..a7da2921de8f21f8a2d6e11954f1efa7423163d4 100644 (file)
@@ -234,7 +234,7 @@ void libxl__logv(libxl_ctx *ctx, xentoollog_level msglevel, int errnoval,
     fileline[sizeof(fileline)-1] = 0;
 
     domain[0] = 0;
-    if (domid != INVALID_DOMID)
+    if (libxl_domid_valid_guest(domid))
         snprintf(domain, sizeof(domain), "Domain %"PRIu32":", domid);
  x:
     xtl_log(ctx->lg, msglevel, errnoval, "libxl",