From patchwork Wed Feb 19 09:37:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11390813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D3D36930 for ; Wed, 19 Feb 2020 09:40:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF9422464E for ; Wed, 19 Feb 2020 09:40:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="hYNxDXJ2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF9422464E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4LoF-00082i-TJ; Wed, 19 Feb 2020 09:38:23 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4LoE-00082Z-RI for xen-devel@lists.xenproject.org; Wed, 19 Feb 2020 09:38:22 +0000 X-Inumbo-ID: 8f621e7e-52fb-11ea-831b-12813bfff9fa Received: from smtp-fw-2101.amazon.com (unknown [72.21.196.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8f621e7e-52fb-11ea-831b-12813bfff9fa; Wed, 19 Feb 2020 09:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1582105099; x=1613641099; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nwjvhvNDZ5TJrA9O6FDgxmDYYDx5Pg4lumR+mOa6LyU=; b=hYNxDXJ2t7Iqw8gaWhyLYUC0KwdKcMf1xUXzjHK79yUx6aTk8rWwcCzT EOtrNBYsE4i+iQMm1UovMSlvoFohSLaoYijjvbwxj0wES1aUUzMiQdn4l 9HeOFZ4UBdXFRW5Mojd8178qaR9oUzcpZUCf/8BRUpI0kvmxBnq2W+tkn s=; IronPort-SDR: mEscnOst+Q7ohGmJ9e2PJDS/UJ9OTgbXfqSFoNPZJmPk/vlG9ObxLy4p/R8DbkW5NmuD0JY6AV 4W+Swcdtr6Ww== X-IronPort-AV: E=Sophos;i="5.70,459,1574121600"; d="scan'208";a="17897396" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1d-74cf8b49.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 19 Feb 2020 09:38:07 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1d-74cf8b49.us-east-1.amazon.com (Postfix) with ESMTPS id 7E815C0855; Wed, 19 Feb 2020 09:38:04 +0000 (UTC) Received: from EX13D32EUB002.ant.amazon.com (10.43.166.114) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Wed, 19 Feb 2020 09:38:04 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D32EUB002.ant.amazon.com (10.43.166.114) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 19 Feb 2020 09:38:03 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 19 Feb 2020 09:38:01 +0000 From: Paul Durrant To: Date: Wed, 19 Feb 2020 09:37:50 +0000 Message-ID: <20200219093754.2924-3-pdurrant@amazon.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200219093754.2924-1-pdurrant@amazon.com> References: <20200219093754.2924-1-pdurrant@amazon.com> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v6 2/6] libxl: modify libxl__logv() to only log valid domid values X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Paul Durrant , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Acked-by: Ian Jackson --- Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD 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",