From nobody Sun Dec 14 12:16:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1763798050; cv=none; d=zohomail.com; s=zohoarc; b=kkRwRrr8x+yBwK7KdLMKbX/gG+J7MqvkXe1GWpGp6sj79sNhBirckA/FtDTtj6bsg3eXRjNzJQZRjzwI+85aMJDADklvZyRWYVGu3Hz47ixaZ270uLqms8dEFN4tzHXqxi8LZVLtm1jG8o5Gh/SgdGipntVVEsJIr+Tn9TEnrO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763798050; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=l0edKEj1cDRgowC+S9LNtkf2YnLKZ9jW9Ik6C51ICHA=; b=ndBkiRlMvTm5eMXIMUXVegrQqzLT0+PKHCvW25MPe4Tu3hoelEF40wEmalgPia9ajfeAOeDEghoRNo5CfuPmcXTmoJeFEjGIu1AN5Uz0J229PTsLoFClvtbA4c4CdM/gzyxXn/XmRbPlMFudZM7nJWgqGC6dirKqxtcZttxh/xA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176379805079852.78046743825348; Fri, 21 Nov 2025 23:54:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vMiKl-0008Fw-RB; Sat, 22 Nov 2025 02:47:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vMhTk-0000gN-R0 for qemu-devel@nongnu.org; Sat, 22 Nov 2025 01:52:23 -0500 Received: from mgamail.intel.com ([192.198.163.14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vMhTN-0000qe-LE for qemu-devel@nongnu.org; Sat, 22 Nov 2025 01:52:12 -0500 Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2025 22:50:22 -0800 Received: from vkasired-desk2.fm.intel.com ([10.105.128.132]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2025 22:50:22 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763794313; x=1795330313; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Upq2JY7yf0Ys2TZJHDdbUd1IroM2T22AHjG73dw2axg=; b=hTvILl+OcEQmMgPbob8C7E9jzu9uKCTL171OhUf4igCDqUMNrjoAKPrv oNrqKi5BH5ooJvaZDNi8348JUBXx0dOCURKOIkbNSyyGmlqjbZY9XNIoZ fiOHIineYnw5nxBf9sCNO+MAkUOBPFTZfYo7hBa5I/9s1rbFKo6uwBlRX MEFCBSrVeVeCAuQKMwbbM98p5jsUzCy0cKoL/kXu1OIs3aqoE5rvnP4Ek NeK/3Q7d0kvgZS4Budh4ny8xT8KaD03mZIgzDVe8dnFVgnmFZv0Bt8lG3 q994GVkmg834bYy9CuqwFIcv3z9LK7eyjD+q9ccj8PPGNVQfg3nyNIYCF w==; X-CSE-ConnectionGUID: /APFKRm+T4+SGcnMeRRlew== X-CSE-MsgGUID: ZuzzI3T9Rce2jXkIurom/Q== X-IronPort-AV: E=McAfee;i="6800,10657,11620"; a="65924069" X-IronPort-AV: E=Sophos;i="6.20,217,1758610800"; d="scan'208";a="65924069" X-CSE-ConnectionGUID: Ml6EIHS3R2e/NRoXnyyfgQ== X-CSE-MsgGUID: bSPxbtQ2QLSZDAups5WFxA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,217,1758610800"; d="scan'208";a="191064608" From: Vivek Kasireddy To: qemu-devel@nongnu.org Cc: Vivek Kasireddy , Alex Williamson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v3 3/9] vfio: Document vfio_device_get_region_info() Date: Fri, 21 Nov 2025 22:46:24 -0800 Message-ID: <20251122064936.2948632-4-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251122064936.2948632-1-vivek.kasireddy@intel.com> References: <20251122064936.2948632-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.198.163.14; envelope-from=vivek.kasireddy@intel.com; helo=mgamail.intel.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1763798052636018900 Add documentation for vfio_device_get_region_info() and clarify the expectations around its usage. Cc: Alex Williamson Cc: C=C3=A9dric Le Goater Signed-off-by: Vivek Kasireddy --- include/hw/vfio/vfio-device.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/hw/vfio/vfio-device.h b/include/hw/vfio/vfio-device.h index 0fe6c60ba2..bb28123faf 100644 --- a/include/hw/vfio/vfio-device.h +++ b/include/hw/vfio/vfio-device.h @@ -257,6 +257,19 @@ void vfio_device_prepare(VFIODevice *vbasedev, VFIOCon= tainer *bcontainer, =20 void vfio_device_unprepare(VFIODevice *vbasedev); =20 +/** + * Return the region info for a given region index. The region info includ= es + * details such as size, offset, and capabilities. Note that the returned + * info pointer is either a cached copy or newly allocated by + * vfio_device_get_region_info(), so the caller is not expected to allocate + * or free it. + * + * @vbasedev: #VFIODevice to use + * @index: region index + * @info: pointer to store the region info + * + * Returns 0 on success or a negative value on error. + */ int vfio_device_get_region_info(VFIODevice *vbasedev, int index, struct vfio_region_info **info); int vfio_device_get_region_info_type(VFIODevice *vbasedev, uint32_t type, --=20 2.50.1