From nobody Sat Feb 7 09:03:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1728670497179218.74214168177832; Fri, 11 Oct 2024 11:14:57 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 22E8C1484; Fri, 11 Oct 2024 14:14:56 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2A51517B1; Fri, 11 Oct 2024 14:13:24 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 787321446; Fri, 11 Oct 2024 14:13:18 -0400 (EDT) Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id CD2E51484 for ; Fri, 11 Oct 2024 14:13:17 -0400 (EDT) Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-2884e7fad77so1287502fac.2 for ; Fri, 11 Oct 2024 11:13:17 -0700 (PDT) Received: from home.. ([2603:8081:c640:1::1003]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2885844a8b7sm1047097fac.58.2024.10.11.11.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 11:13:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728670396; x=1729275196; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LWabdXhoaDtbLPQS/q+K7D7F/8888cln3zYRCp5ZVZM=; b=QCVOPKIoRYbtgoHFZr1HKowmlWVW0F5wQvPMz3S7E94rYtHHkrkMCA7UkQVw3bGJ/Z oK9wXdR95mORsH3TSN8pb4pscPs4s5+UfxtbDZUhDhu4QqfFvLSYg5W+LMwz6rk5mOwj duqFGa8twv9Zso8/mYjvJOU89ZGeuKJPQ0SplPPF0fViUk3ghGOM8m7RWfdY7Aqy91ZV L6ptchvpwxWckAYOzhgpvUM+83BPFkFmbOqplM+bGHXfwQgtiDEuNubDt75gd05wV1g8 ER3g3W5OHymfLifxsNJytLhUFe6hO1g07BzdCN/om7iwguUlIg5kYBNcAVaxypv049Hy nDOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728670396; x=1729275196; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LWabdXhoaDtbLPQS/q+K7D7F/8888cln3zYRCp5ZVZM=; b=gGL06vNQRa/1YtWE5qYUEwItDyF9Lq4J2sO1Jf4lfh0gdaP08+pxJXMmt1z4IMibLD NLToO+ZVFcrEdSXuqg9ovEA/tizkfH1vAj1ho2BH6YvMSaTrThMcRUaNPUA616m0ZFLS 4nvO8LIYybk5syA9CHBSTL1quzrpO+64Qq4jtqzj+gs3dzhTicaosg1Mxiv7tgltTxYH yuBlot0KbtAmU4TyoloCH8AQCcEEHGzJ5HwNsKR65HSAOq+7uQ+dt5N3lbwZg+jUspHf tSITWASuE5DC5x64EMDQyjc/vyDXv0lVCd0+TBlZhfk/vEZF7XQ41PSPWIYflGfHQhvi YW+A== X-Gm-Message-State: AOJu0Yxu3WXoWaFkkqvsq4FDsvBqC9mxJd5l2N1cxiNhBwUcUy5lVgiP aVkiSCo4IQOaUB85hrxBfnGznRtDI3DVLKR5BYhziRncdGAieibUbkWhkw== X-Google-Smtp-Source: AGHT+IE7L3ILd0vhMbtsBprQwZE1otXFSMfo+I73p6LhanOWXiBgJM/iSMZ07JiE2aRX3SQX2pC3xg== X-Received: by 2002:a05:6870:7196:b0:287:29a0:cfe4 with SMTP id 586e51a60fabf-2886dfff304mr2241747fac.32.1728670396622; Fri, 11 Oct 2024 11:13:16 -0700 (PDT) From: Praveen K Paladugu X-Google-Original-From: Praveen K Paladugu To: devel@lists.libvirt.org Subject: [PATCH 03/10] qemu: replace qemuHostdevPreparePCIDevices Date: Fri, 11 Oct 2024 13:13:04 -0500 Message-ID: <20241011181311.6813-4-prapal@linux.microsoft.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241011181311.6813-1-prapal@linux.microsoft.com> References: <20241011181311.6813-1-prapal@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MNECXOK2T5MDUNMBU6DURLCJ4I44GOIH X-Message-ID-Hash: MNECXOK2T5MDUNMBU6DURLCJ4I44GOIH X-MailFrom: praveenkpaladugu@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: liuwe@microsoft.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1728670497686116600 Content-Type: text/plain; charset="utf-8" qemuHostdevPreparePCIDevices, virHostdevPreparePCIDevices are identical. Replacing qemu method with the generic one to reduce code duplication. This generic method will be used in ch driver to passthrough PCI devices. Signed-off-by: Praveen K Paladugu --- src/qemu/qemu_hostdev.c | 17 ++--------------- src/qemu/qemu_hostdev.h | 6 ------ src/qemu/qemu_hotplug.c | 5 +++-- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index ab2769d482..894f12e04f 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -152,20 +152,6 @@ qemuHostdevPrepareNVMeDisks(virQEMUDriver *driver, name, disks, ndisks); } =20 -int -qemuHostdevPreparePCIDevices(virQEMUDriver *driver, - const char *name, - const unsigned char *uuid, - virDomainHostdevDef **hostdevs, - int nhostdevs, - unsigned int flags) -{ - return virHostdevPreparePCIDevices(driver->hostdevMgr, - QEMU_DRIVER_NAME, - name, uuid, hostdevs, - nhostdevs, flags); -} - int qemuHostdevPrepareUSBDevices(virQEMUDriver *driver, const char *name, @@ -244,7 +230,8 @@ qemuHostdevPrepareDomainDevices(virQEMUDriver *driver, if (qemuHostdevPrepareNVMeDisks(driver, def->name, def->disks, def->nd= isks) < 0) return -1; =20 - if (qemuHostdevPreparePCIDevices(driver, def->name, def->uuid, + if (virHostdevPreparePCIDevices(driver->hostdevMgr, QEMU_DRIVER_NAME, + def->name, def->uuid, def->hostdevs, def->nhostdevs, flags)= < 0) return -1; =20 diff --git a/src/qemu/qemu_hostdev.h b/src/qemu/qemu_hostdev.h index b6dd2e0207..6f6c4f82bc 100644 --- a/src/qemu/qemu_hostdev.h +++ b/src/qemu/qemu_hostdev.h @@ -43,12 +43,6 @@ int qemuHostdevPrepareNVMeDisks(virQEMUDriver *driver, const char *name, virDomainDiskDef **disks, size_t ndisks); -int qemuHostdevPreparePCIDevices(virQEMUDriver *driver, - const char *name, - const unsigned char *uuid, - virDomainHostdevDef **hostdevs, - int nhostdevs, - unsigned int flags); int qemuHostdevPrepareUSBDevices(virQEMUDriver *driver, const char *name, virDomainHostdevDef **hostdevs, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 4d4bcde1bc..d1c042c6a0 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1544,8 +1544,9 @@ qemuDomainAttachHostPCIDevice(virQEMUDriver *driver, =20 if (!cfg->relaxedACS) flags |=3D VIR_HOSTDEV_STRICT_ACS_CHECK; - if (qemuHostdevPreparePCIDevices(driver, vm->def->name, - vm->def->uuid, &hostdev, 1, flags) < = 0) + if (virHostdevPreparePCIDevices(driver->hostdevMgr, QEMU_DRIVER_NAME, + vm->def->name, vm->def->uuid, + &hostdev, 1, flags) < 0) return -1; =20 if (qemuDomainAdjustMaxMemLockHostdev(vm, hostdev) < 0) --=20 2.44.0