From nobody Tue Feb 10 02:43:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1691577256; cv=none; d=zohomail.com; s=zohoarc; b=gT/+TWKo/NwHBO0VewVY2OXPv1Y08+/q6KEzlOt3TQB8CuKHDonBjA5BP4Aj+A39Y/NOFGhnje2tcuPd9fQsgxqb9V5f4/lJW17dqb0sBebIMejYQCcqL9D4cD61L8364ZN5bxGmuNJ2r6ZaqXga0vRAotsaSGgD0hcMEemvWrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691577256; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WDE+FPlIuV/hN9LV2qapinnwY81PAynIDFvx+oUY3q0=; b=gPZN/lDBTZ9xvH+BRKdwHczd3i4hkUHju49etRrq4odENqZBG7qzQZogcZjwgvtvKx6xRkAE57MpEvdoRUc5L4j6VaTEsRpkayelsfNhFlPclaI7Nr0DW2k9CZ1+3aEbnq7KQbp/eXaUUIg9lf2GXqe9Ge4Pr37/rU0vyrh9FXE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1691577256795155.21509333382926; Wed, 9 Aug 2023 03:34:16 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.580830.909268 (Exim 4.92) (envelope-from ) id 1qTgVi-0006sp-7S; Wed, 09 Aug 2023 10:33:50 +0000 Received: by outflank-mailman (output) from mailman id 580830.909268; Wed, 09 Aug 2023 10:33:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTgVi-0006si-4i; Wed, 09 Aug 2023 10:33:50 +0000 Received: by outflank-mailman (input) for mailman id 580830; Wed, 09 Aug 2023 10:33:48 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTgVg-0006oL-Is for xen-devel@lists.xenproject.org; Wed, 09 Aug 2023 10:33:48 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTgVg-0005Ho-6p; Wed, 09 Aug 2023 10:33:48 +0000 Received: from 54-240-197-232.amazon.com ([54.240.197.232] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qTgVf-0000jc-VN; Wed, 09 Aug 2023 10:33:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=WDE+FPlIuV/hN9LV2qapinnwY81PAynIDFvx+oUY3q0=; b=2/HvtZVAIIxaq4laM3RlmqP9u/ KlqMLwy4JjvxKWssqvOY5gbS2KIst6EDtSw8xcXVYDlPTEL/xmqKkpjEFYiny8Z6dCEANSSkIDUnr D4P7cDFz0lktOvORmbw1TtcPHWUg1x8y14V4Eza4I+6sgmulDoiXTQ1gbqypVd9Yg4Yo=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Julien Grall , Wei Liu , Anthony PERARD , Juergen Gross Subject: [PATCH 1/2] tools/libs: light: Remove the variable 'domainid' do_pci_remove() Date: Wed, 9 Aug 2023 11:33:04 +0100 Message-Id: <20230809103305.30561-2-julien@xen.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230809103305.30561-1-julien@xen.org> References: <20230809103305.30561-1-julien@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1691577257823100001 Content-Type: text/plain; charset="utf-8" From: Julien Grall The function do_pci_remove() has two local variables 'domid' and 'domainid' containing the same value. Looking at the history, until 2cf3b50dcd8b ("libxl_pci: Use libxl__ao_device with pci_remove") the two variables may have different value when using a stubdomain. As this is not the case now, remove 'domainid'. This will reduce the confusion between the two variables. Note that there are other places in libxl_pci.c which are using the two confusing names within the same function. They are left unchanged for now. No functional changes intented. Signed-off-by: Julien Grall Acked-by: Anthony PERARD Reviewed-by: Jason Andryuk --- tools/libs/light/libxl_pci.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c index 27d9dbff2522..7f5f170e6eb0 100644 --- a/tools/libs/light/libxl_pci.c +++ b/tools/libs/light/libxl_pci.c @@ -1953,8 +1953,6 @@ static void do_pci_remove(libxl__egc *egc, pci_remove= _state *prs) libxl_domain_type type =3D libxl__domain_type(gc, domid); libxl_device_pci *pci =3D &prs->pci; int rc, num; - uint32_t domainid =3D domid; - pcis =3D libxl_device_pci_list(ctx, domid, &num); if (!pcis) { rc =3D ERROR_FAIL; @@ -1966,7 +1964,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove= _state *prs) =20 rc =3D ERROR_INVAL; if (!attached) { - LOGD(ERROR, domainid, "PCI device not attached to this domain"); + LOGD(ERROR, domid, "PCI device not attached to this domain"); goto out_fail; } =20 @@ -2000,7 +1998,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove= _state *prs) int i; =20 if (f =3D=3D NULL) { - LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path); + LOGED(ERROR, domid, "Couldn't open %s", sysfs_path); goto skip1; } for (i =3D 0; i < PROC_PCI_NUM_RESOURCES; i++) { @@ -2011,7 +2009,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove= _state *prs) if (flags & PCI_BAR_IO) { rc =3D xc_domain_ioport_permission(ctx->xch, domid, st= art, size, 0); if (rc < 0) - LOGED(ERROR, domainid, + LOGED(ERROR, domid, "xc_domain_ioport_permission error 0x%x/0x%x= ", start, size); @@ -2019,7 +2017,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove= _state *prs) rc =3D xc_domain_iomem_permission(ctx->xch, domid, sta= rt>>XC_PAGE_SHIFT, (size+(XC_PAGE_SIZE-1)= )>>XC_PAGE_SHIFT, 0); if (rc < 0) - LOGED(ERROR, domainid, + LOGED(ERROR, domid, "xc_domain_iomem_permission error 0x%x/0x%x", start, size); @@ -2034,17 +2032,17 @@ skip1: pci->bus, pci->dev, pci->func); f =3D fopen(sysfs_path, "r"); if (f =3D=3D NULL) { - LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path); + LOGED(ERROR, domid, "Couldn't open %s", sysfs_path); goto skip_irq; } if ((fscanf(f, "%u", &irq) =3D=3D 1) && irq) { rc =3D xc_physdev_unmap_pirq(ctx->xch, domid, irq); if (rc < 0) { - LOGED(ERROR, domainid, "xc_physdev_unmap_pirq irq=3D%d", i= rq); + LOGED(ERROR, domid, "xc_physdev_unmap_pirq irq=3D%d", irq); } rc =3D xc_domain_irq_permission(ctx->xch, domid, irq, 0); if (rc < 0) { - LOGED(ERROR, domainid, "xc_domain_irq_permission irq=3D%d"= , irq); + LOGED(ERROR, domid, "xc_domain_irq_permission irq=3D%d", i= rq); } } fclose(f); --=20 2.40.1