From nobody Mon Feb 9 17:06:41 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579793636; cv=none; d=zohomail.com; s=zohoarc; b=Zv4TYMKDnHBeo46t9Xz6gABFZWV+JmrCkyCdl2AlKxvu5LOtJjpstuqjv5g7ixL79SiQbRE/PJ2vH2kwUL8nUeggH6AhTjCwoWe5HMdLMyIWF/IhYui6l3TH1eneous6NBsyeOA9veXwZ8YWeThTfHrQDTX3nUBXROgnRQFf1GM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579793636; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iMY7RCyLDjVvD/6DMcsQnff3G2M3+BaxKEPV2kf0Sdo=; b=ctO2SsmXOyd34VeLk2Hy1oR3DpyxzpbeR7o6zaCMstM2qULvFYTik10RvPVp2fpV/pg9zDGGWXKlbRfOyWSxF5CXAgWy+c1iNY4njXAHW4E25SPSu8Sbr9lbDq1wAYEH7rNWCs8yDGEfKyT/6fk7+38f+ayfxOXQMxez8N7MFYs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579793636717171.67748808450926; Thu, 23 Jan 2020 07:33:56 -0800 (PST) Received: from localhost ([::1]:59520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iueUU-0002Ru-Lz for importer@patchew.org; Thu, 23 Jan 2020 10:33:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51647) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucrb-0005Ik-DI for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucra-00042M-6n for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:39 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:42618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucra-0003yD-04 for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:38 -0500 Received: by mail-wr1-x42c.google.com with SMTP id q6so3120238wro.9 for ; Thu, 23 Jan 2020 05:49:37 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iMY7RCyLDjVvD/6DMcsQnff3G2M3+BaxKEPV2kf0Sdo=; b=B11h9vC83d5DX0RkqTTv9sx7Q7jXyKLFhtU7h63Qa0zeZr3NRynrFYzWwVbPs5NSAy Ijz/pXUodkRbllvzhuO0EMzH1QdeFe1O6GYhF121iQH3VLUUWb0forb0h7KWPYZ8J4Ij 6ylvnBlfBadurrb/YX+50E2yMuBWJ4uWSphaw9jgX9rnbB4Jwek7twrF1sHzzwNdvRL+ ootgy8NOWV3a5TTeMywcj2lgJ9aozjcEJtJSUuxYAb5frdPB3DSJ0U/MXVC42nMQmqDN wfID7t34uU9K/mcTXFV5TuoBAvyLcDyXJCMxkiARSt+EfJYI2r76E/n2z18cWgCTWNuT fd0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iMY7RCyLDjVvD/6DMcsQnff3G2M3+BaxKEPV2kf0Sdo=; b=qY4++3jSGYwc9/Sl1PI8OcCCeaxqpOaJQRO+vCgGfZ6k7hJctNGlbvQRe9IpV6gWh+ OXxcEKiuExQWuWmaPDSXagL+JWKu6YbdcFc7SiNur2hbp8QZMOBYAoxOaGMx5i8HVzXH 8iqYK1xHoG5k5H6/1MYqP9knbfPQ5Y3P46h9VbDu/Y5aQiz5TKb/gJKafplwcweC8/wd GwEu2fH8jxjBtrSRnB/dD45LWrv3TjNRXPTPj8WuUO7P4Hijwm0OoK8yx+z9pHSlCWpG ruT4Emv0OCdqMRvq0oWHU8XfcixgSmjE335+dl+ijF0b5xOR92GOpqu9QXtClusslZL9 9lWQ== X-Gm-Message-State: APjAAAXhBFEibv1muDeO6cNYqneU9vqmocc1f0OeHMF2rYADGpLnpk6P ejSz0B8ri5hKCpjN0ppPTXoiepgi X-Google-Smtp-Source: APXvYqzO/wfzNBsPUxWqsX52SJ/PORF98s8kBd5OzOY0JXkcvF9O/qESv5FHWKRy5Y7qIOprMaKSqg== X-Received: by 2002:adf:df03:: with SMTP id y3mr17892903wrl.260.1579787376819; Thu, 23 Jan 2020 05:49:36 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 34/59] qdev: move helper function to monitor/misc Date: Thu, 23 Jan 2020 14:48:37 +0100 Message-Id: <1579787342-27146-35-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Move the one-user function to the place it is being used. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200110153039.1379601-5-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/qdev.c | 26 -------------------------- include/hw/qdev-core.h | 2 -- monitor/misc.c | 26 ++++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 60aec8b..8708605 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -760,32 +760,6 @@ void qdev_alias_all_properties(DeviceState *target, Ob= ject *source) } while (class !=3D object_class_by_name(TYPE_DEVICE)); } =20 -static int qdev_add_hotpluggable_device(Object *obj, void *opaque) -{ - GSList **list =3D opaque; - DeviceState *dev =3D (DeviceState *)object_dynamic_cast(OBJECT(obj), - TYPE_DEVICE); - - if (dev =3D=3D NULL) { - return 0; - } - - if (dev->realized && object_property_get_bool(obj, "hotpluggable", NUL= L)) { - *list =3D g_slist_append(*list, dev); - } - - return 0; -} - -GSList *qdev_build_hotpluggable_device_list(Object *peripheral) -{ - GSList *list =3D NULL; - - object_child_foreach(peripheral, qdev_add_hotpluggable_device, &list); - - return list; -} - static bool device_get_realized(Object *obj, Error **errp) { DeviceState *dev =3D DEVICE(obj); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 1518495..6b0e7b2 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -457,8 +457,6 @@ extern bool qdev_hot_removed; =20 char *qdev_get_dev_path(DeviceState *dev); =20 -GSList *qdev_build_hotpluggable_device_list(Object *peripheral); - void qbus_set_hotplug_handler(BusState *bus, Object *handler, Error **errp= ); =20 void qbus_set_bus_hotplug_handler(BusState *bus, Error **errp); diff --git a/monitor/misc.c b/monitor/misc.c index de1ca4d..4752150 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -1959,6 +1959,32 @@ void object_add_completion(ReadLineState *rs, int nb= _args, const char *str) g_slist_free(list); } =20 +static int qdev_add_hotpluggable_device(Object *obj, void *opaque) +{ + GSList **list =3D opaque; + DeviceState *dev =3D (DeviceState *)object_dynamic_cast(OBJECT(obj), + TYPE_DEVICE); + + if (dev =3D=3D NULL) { + return 0; + } + + if (dev->realized && object_property_get_bool(obj, "hotpluggable", NUL= L)) { + *list =3D g_slist_append(*list, dev); + } + + return 0; +} + +static GSList *qdev_build_hotpluggable_device_list(Object *peripheral) +{ + GSList *list =3D NULL; + + object_child_foreach(peripheral, qdev_add_hotpluggable_device, &list); + + return list; +} + static void peripheral_device_del_completion(ReadLineState *rs, const char *str, size_t len) { --=20 1.8.3.1