From nobody Wed Nov 27 04:31:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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 ARC-Seal: i=1; a=rsa-sha256; t=1701504217; cv=none; d=zohomail.com; s=zohoarc; b=mMdrCm6I1qVFcgIT4QOAewT0bjqgrRhzUbOkr5wlaEhAMqf5tW0nOkcF9fkvmFoyNoCwkJxs6guOInEmrd/ycdzvu/BaozrAIXzdrxl0SOjIccgvYQ76M2I4ltBV6+WJibgADQZt0FNHWPHPpHxW+MBx4OPERi4zj5t0k1epIJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701504217; 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=FtHitzkUtA9s8p+8tFrhebFAAv44x+6SLPyGvXp0SkM=; b=KrpigL363mWZpa+Fx7zC+1awoX82l6pKbVPbcrZG57To6Yfe1SLQZgHjlLIl2RV5hils6aWXmBevgxhC1UjJfZiWBKT+Y1bxcEVctY/wAfMOQhgZBWYAN6gdCtcQ0AxZu/N4oFfzTO7yPy/2OxNE9Kxri3xxUIaxT/K+JV9LFqQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1701504217279271.2940235414054; Sat, 2 Dec 2023 00:03:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9KwA-0004Pk-S9; Sat, 02 Dec 2023 03:01:18 -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 1r9Kvv-0004Mh-Kd for qemu-devel@nongnu.org; Sat, 02 Dec 2023 03:01:04 -0500 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9Kvt-00051Q-49 for qemu-devel@nongnu.org; Sat, 02 Dec 2023 03:01:03 -0500 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-35d396ae91fso10315205ab.3 for ; Sat, 02 Dec 2023 00:01:00 -0800 (PST) Received: from localhost ([157.82.205.15]) by smtp.gmail.com with UTF8SMTPSA id q11-20020a170902a3cb00b001a98f844e60sm4587690plb.263.2023.12.02.00.00.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Dec 2023 00:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1701504060; x=1702108860; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FtHitzkUtA9s8p+8tFrhebFAAv44x+6SLPyGvXp0SkM=; b=IL9QxYvh1BMyCo4CVdKMX8Utf66FpjiMk3MfMPIKTwM5yac0lHBcHwt5fuVo5pBzPV FEVFZ6iMaSRwBk3WgTWSrF6F9MNShlUDwurhTaqBdQEg777OGCrWirg4FV48bY+PIAf+ YPaYqIADTAVnF1h18QieNRXZaHof8Gh4bpEgMrgZNMPCbX52uOeSPhTtQu49lTJWM7aR oo/kJkPnopVSfXCqZfxpPbl2kFNCKCzf/SLuZHlJYa2dccmqc+JPVVl6Y0ahNkmPMNej TsfFuJJ75gwIjHSC8rh2XvnnYTBH/zhUISmgT8zJcaFvXMgn+1O/O1G4S5MuXasg8HW4 mraA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701504060; x=1702108860; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FtHitzkUtA9s8p+8tFrhebFAAv44x+6SLPyGvXp0SkM=; b=CUZ7ha7cgBZiqh496Apr4R/zio3A17NBnqo408wns5ZWeagdBt6/dhLzaYHEapchpl goB9w0dZFa6FEU/3H4j4dW+5eTxwN67o0jAiZDRpk3YnJDBFE+VZdfx9/DCh3x8bczun ZDvWxC6zgJ8CzU/RPtiDIcasgPPAdNA5es6GPm+jqk7ph+R5PJsdkGiHotkAt4Ejsxpm 6yLCIWRB1fXjcWu+Hao1sSdrDFXjiTo4jyZhDL4J1k6VnFKtq3CcdrG43yW/BR4dg2Xh +JSs7ai5pkWqWJUaiz5wBIeneejAtKWn/8IXE1OHpOBeiOGsDO6Icf6Qjir3SZPw2DGz IRpw== X-Gm-Message-State: AOJu0YzXLHQkXNQhylDdf7c/tRl2NQvu0X9jmaHDpYQ9Ahj7/E8Rkn/w 2X2+Cbg2fXELAg2CtI+X/OtDCg== X-Google-Smtp-Source: AGHT+IGcx+erN1zGqRmllSQfRVjs05PCWY8p+aRCrjJ9b9gyZwc4QuuWB8kCWb379lfuRW8j8InqOw== X-Received: by 2002:a05:6e02:154b:b0:35d:59a2:332d with SMTP id j11-20020a056e02154b00b0035d59a2332dmr1098657ilu.49.1701504060175; Sat, 02 Dec 2023 00:01:00 -0800 (PST) From: Akihiko Odaki Date: Sat, 02 Dec 2023 17:00:29 +0900 Subject: [PATCH 06/14] qdev: Remove DeviceListener::hide_device() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231202-sriov-v1-6-32b3570f7bd6@daynix.com> References: <20231202-sriov-v1-0-32b3570f7bd6@daynix.com> In-Reply-To: <20231202-sriov-v1-0-32b3570f7bd6@daynix.com> To: "Michael S. Tsirkin" , Marcel Apfelbaum , Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Jason Wang , Sriram Yagnaraman , Keith Busch , Klaus Jensen Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Yui Washizu , Akihiko Odaki X-Mailer: b4 0.12.4 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: none client-ip=2607:f8b0:4864:20::135; envelope-from=akihiko.odaki@daynix.com; helo=mail-il1-x135.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1701504219012000003 It is no longer used. Signed-off-by: Akihiko Odaki --- include/hw/qdev-core.h | 24 ------------------------ hw/core/qdev.c | 18 ------------------ system/qdev-monitor.c | 9 --------- 3 files changed, 51 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index de221b6f02..9acf6f79c4 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -306,17 +306,6 @@ struct DeviceState { struct DeviceListener { void (*realize)(DeviceListener *listener, DeviceState *dev); void (*unrealize)(DeviceListener *listener, DeviceState *dev); - /* - * This callback is called upon init of the DeviceState and - * informs qdev if a device should be visible or hidden. We can - * hide a failover device depending for example on the device - * opts. - * - * On errors, it returns false and errp is set. Device creation - * should fail in this case. - */ - bool (*hide_device)(DeviceListener *listener, const QDict *device_opts, - bool from_json, Error **errp); QTAILQ_ENTRY(DeviceListener) link; }; =20 @@ -1054,19 +1043,6 @@ static inline void qbus_mark_full(BusState *bus) void device_listener_register(DeviceListener *listener); void device_listener_unregister(DeviceListener *listener); =20 -/** - * qdev_should_hide_device() - check if device should be hidden - * - * @opts: options QDict - * @from_json: true if @opts entries are typed, false for all strings - * @errp: pointer to error object - * - * When a device is added via qdev_device_add() this will be called. - * - * Return: if the device should be added now or not. - */ -bool qdev_should_hide_device(const QDict *opts, bool from_json, Error **er= rp); - typedef enum MachineInitPhase { /* current_machine is NULL. */ PHASE_NO_MACHINE, diff --git a/hw/core/qdev.c b/hw/core/qdev.c index c98691a90d..e61a147016 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -224,24 +224,6 @@ void device_listener_unregister(DeviceListener *listen= er) QTAILQ_REMOVE(&device_listeners, listener, link); } =20 -bool qdev_should_hide_device(const QDict *opts, bool from_json, Error **er= rp) -{ - ERRP_GUARD(); - DeviceListener *listener; - - QTAILQ_FOREACH(listener, &device_listeners, link) { - if (listener->hide_device) { - if (listener->hide_device(listener, opts, from_json, errp)) { - return true; - } else if (*errp) { - return false; - } - } - } - - return false; -} - void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, int required_for_version) { diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 639beabc5f..42aac94b8c 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -660,15 +660,6 @@ DeviceState *qdev_device_add_from_qdict(const QDict *o= pts, } } =20 - if (qdev_should_hide_device(opts, from_json, errp)) { - if (bus && !qbus_is_hotpluggable(bus)) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, bus->name); - } - return NULL; - } else if (*errp) { - return NULL; - } - if (dc->hide) { if (dc->hide(dc, opts, from_json, errp)) { if (bus && !qbus_is_hotpluggable(bus)) { --=20 2.43.0