All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <pdurrant@amazon.com>
To: <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Paul Durrant <pdurrant@amazon.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>
Subject: [Xen-devel] [PATCH v7 2/6] libxl: modify libxl__logv() to only log valid domid values
Date: Fri, 21 Feb 2020 11:20:45 +0000	[thread overview]
Message-ID: <20200221112049.3077-3-pdurrant@amazon.com> (raw)
In-Reply-To: <20200221112049.3077-1-pdurrant@amazon.com>

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>
---
Cc: Wei Liu <wl@xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>

v6:
 - New in v6 (split out from another patch)
---
 tools/libxl/libxl_internal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index bbd4c6cba9..d93a75533f 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -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",
-- 
2.20.1


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

  parent reply	other threads:[~2020-02-21 11:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 11:20 [Xen-devel] [PATCH v7 0/6] xl/libxl: domid allocation/preservation changes Paul Durrant
2020-02-21 11:20 ` [Xen-devel] [PATCH v7 1/6] libxl: add infrastructure to track and query 'recent' domids Paul Durrant
2020-02-24 15:52   ` Ian Jackson
2020-02-21 11:20 ` Paul Durrant [this message]
2020-02-21 12:07   ` [Xen-devel] [PATCH v7 2/6] libxl: modify libxl__logv() to only log valid domid values Wei Liu
2020-02-21 11:20 ` [Xen-devel] [PATCH v7 3/6] public/xen.h: add a definition for a 'valid domid' mask Paul Durrant
2020-02-21 20:47   ` Julien Grall
2020-02-21 11:20 ` [Xen-devel] [PATCH v7 4/6] libxl: allow creation of domains with a specified or random domid Paul Durrant
2020-02-21 11:20 ` [Xen-devel] [PATCH v7 5/6] xl.conf: introduce 'domid_policy' Paul Durrant
2020-02-21 11:20 ` [Xen-devel] [PATCH v7 6/6] xl: allow domid to be preserved on save/restore or migrate Paul Durrant
2020-02-24 15:54 ` [Xen-devel] [PATCH v7 0/6] xl/libxl: domid allocation/preservation changes Ian Jackson
2020-02-24 16:32   ` Durrant, Paul
2020-02-24 17:22     ` Durrant, Paul
2020-02-24 17:56       ` Ian Jackson
2020-02-25  8:26         ` Durrant, Paul

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=20200221112049.3077-3-pdurrant@amazon.com \
    --to=pdurrant@amazon.com \
    --cc=anthony.perard@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wl@xen.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.