From nobody Sun Nov 24 20:56:11 2024 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=1721030893; cv=none; d=zohomail.com; s=zohoarc; b=VpaNE5WM1irQLsr768pESWDzcISBgO+MCY/8t6ZNyTt0E/drlyOOmA8otv/Rfx98cJi9mrmQieODYsvp2UJI+/7koQVoewXcaqGrUoefLmh2j1NTIctnRPfrYsOfbDjwJP4j2Bs8k3YcOYgjHZNLIIn2vNP/ThTaJ7nhwnC3jgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721030893; 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=IWHwHXJobqjT1rh9BKyDpmam1JSZGs+YkkoS7lRnS+g=; b=CL5BcwZhm23m6jTlSQzdcG4rqimuGoLfsCrVKowlsPRJIwn5qBRQWsmqwhitm2UzUKwJF4QrCl9fH8kFjlZNbuC/lewoQJfZc846eY879DVpVIFRyrUUTXzkAw0GuE01ZY0I7zsDoSV7o0X8GG2YVPtT6Hy2b261nKfsbE8udcI= 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 1721030893208412.92352554615945; Mon, 15 Jul 2024 01:08:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTGju-0003BE-HL; Mon, 15 Jul 2024 04:07:18 -0400 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 1sTGjr-0002zt-Ve; Mon, 15 Jul 2024 04:07:15 -0400 Received: from mgamail.intel.com ([192.198.163.8]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTGje-00047o-F9; Mon, 15 Jul 2024 04:07:15 -0400 Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2024 01:06:41 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmviesa009.fm.intel.com with ESMTP; 15 Jul 2024 01:06:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721030823; x=1752566823; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RoxEAFvBU5+co7FmGTVK5jcrRDDIG8H4tO5qqtRbR/E=; b=Wk4H1Pqx70/XgCfcrto4U/fja5o1M/wpFRHgNkb8g6Pa0l5AHzkNIvxY NmUZrZdiu9+H0unYWIZTOzDNgfWCZCNEdlZcr90v1GCyDM7FGmosCF4M9 7KbvVpV+qKT8DkjtNZDA+/i5jrgYHR/F4leSKiV9KdYaIVqYWPxoqRFEy ouTjnuSEdVJzn4CFrPFivRRL5EyyD90uFsiBmzu1vhj5ihcheTbqOQevo kIkwZ+z6cIwYvWoIVyTYZdEx9yVqVDMBC+35wF4J1QXoKm/XnT69wotiF hjV8iAB/xqkKMhj2S0etHOp54q92ra2AX1Z+zkvgKV8gBKH9RP25aKwfX g==; X-CSE-ConnectionGUID: W52Pe4r3ToGkiUy6A62JXw== X-CSE-MsgGUID: ofT8bXUYTmC9rXXgdWs32Q== X-IronPort-AV: E=McAfee;i="6700,10204,11133"; a="35935662" X-IronPort-AV: E=Sophos;i="6.09,209,1716274800"; d="scan'208";a="35935662" X-CSE-ConnectionGUID: tGq/A5TPS++20uYbEXwzJQ== X-CSE-MsgGUID: EeHdx6fcQkKDznH5VelWjg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,209,1716274800"; d="scan'208";a="49512588" From: Zhao Liu To: Michael Tokarev , Laurent Vivier Cc: =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Markus Armbruster , Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-trivial@nongnu.org, qemu-devel@nongnu.org, Zhao Liu , Alex Williamson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 4/7] hw/vfio/container: Get rid of qemu_open_old() Date: Mon, 15 Jul 2024 16:21:52 +0800 Message-Id: <20240715082155.28771-5-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240715082155.28771-1-zhao1.liu@intel.com> References: <20240715082155.28771-1-zhao1.liu@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.8; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: 1721030894750116600 For qemu_open_old(), osdep.h said: > Don't introduce new usage of this function, prefer the following > qemu_open/qemu_create that take an "Error **errp". So replace qemu_open_old() with qemu_open(). Cc: Alex Williamson Cc: "C=C3=A9dric Le Goater" Signed-off-by: Zhao Liu Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/container.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 425db1a14c07..38a9df34964a 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -600,9 +600,8 @@ static bool vfio_connect_container(VFIOGroup *group, Ad= dressSpace *as, } } =20 - fd =3D qemu_open_old("/dev/vfio/vfio", O_RDWR); + fd =3D qemu_open("/dev/vfio/vfio", O_RDWR, errp); if (fd < 0) { - error_setg_errno(errp, errno, "failed to open /dev/vfio/vfio"); goto put_space_exit; } =20 @@ -743,9 +742,8 @@ static VFIOGroup *vfio_get_group(int groupid, AddressSp= ace *as, Error **errp) group =3D g_malloc0(sizeof(*group)); =20 snprintf(path, sizeof(path), "/dev/vfio/%d", groupid); - group->fd =3D qemu_open_old(path, O_RDWR); + group->fd =3D qemu_open(path, O_RDWR, errp); if (group->fd < 0) { - error_setg_errno(errp, errno, "failed to open %s", path); goto free_group_exit; } =20 --=20 2.34.1