From nobody Tue Nov 11 17:32:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=fail Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1564412469307922.8230281869006; Mon, 29 Jul 2019 08:01:09 -0700 (PDT) Received: from localhost ([::1]:52896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs799-0006MK-Fh for importer@patchew.org; Mon, 29 Jul 2019 11:01:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37540) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs776-0003re-9M for qemu-devel@nongnu.org; Mon, 29 Jul 2019 10:59:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs775-0004SN-4m for qemu-devel@nongnu.org; Mon, 29 Jul 2019 10:59:00 -0400 Received: from beetle.greensocs.com ([5.135.226.135]:47916) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hs770-0004N6-24; Mon, 29 Jul 2019 10:58:54 -0400 Received: from kouign-amann.bar.greensocs.com (unknown [172.16.11.117]) by beetle.greensocs.com (Postfix) with ESMTPS id CB8D696F57; Mon, 29 Jul 2019 14:58:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greensocs.com; s=mail; t=1564412333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aiqIrflaNa5CRchlhs9CsppxO8rAtOcqpCOtOp1k/GM=; b=y/nSaNI3ftY/Dq5tWvoieZ6AG3WpTgK2q089LYRUthhT9/3A3Eo17BP1WA0iVkgQ05IYO8 Of7Gfr1h4VDFnOWevw/L3OlJ7DIvgBsiuI1zCTp2XeZfT54gLODTrrKnDaopS2ZfkRWAbt nBrkxri0RDwd7xTInUgk3dBtHwsX3xk= From: Damien Hedde To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 16:56:23 +0200 Message-Id: <20190729145654.14644-3-damien.hedde@greensocs.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729145654.14644-1-damien.hedde@greensocs.com> References: <20190729145654.14644-1-damien.hedde@greensocs.com> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=greensocs.com; s=mail; t=1564412333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aiqIrflaNa5CRchlhs9CsppxO8rAtOcqpCOtOp1k/GM=; b=EMrJ6Y/iaFuBsQibLU0FN6ClIWd4wIuVbUdOkhxVDhCIoN8Xdtae2obZKPww/WefgFUi/Y 0DUOYKtHhvBJhUQM6JRfIRDj7gA+2mpxX7wjawpOjYOK5hI6STQTk2dJUH1zwN/neRIFNQ Ib/UBZkTjBTWUIH0u3vjlIm70qRBNGM= ARC-Seal: i=1; s=mail; d=greensocs.com; t=1564412333; a=rsa-sha256; cv=none; b=BScCHCRyXaFec7+DGK/1ylR21Ja4QM9+etlE1NgbhrlgMquU5P6sU+S8/on4WxW+Uc8DDU ofN4hpErXuTuO9+AVE9DCLOmBnaFkxmmGKfD3QiZgshgCMyAhLk2b/8ZvniqlHYXm+x8N6 f8zb8tcwG2Xeh6QRGyuU7JDeKleOzGI= ARC-Authentication-Results: i=1; beetle.greensocs.com; none X-Spam: Yes Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 5.135.226.135 Subject: [Qemu-devel] [PATCH v3 02/33] add temporary device_legacy_reset function to replace device_reset 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: fam@euphon.net, peter.maydell@linaro.org, walling@linux.ibm.com, dmitry.fleytman@gmail.com, mst@redhat.com, mark.cave-ayland@ilande.co.uk, kraxel@redhat.com, edgar.iglesias@xilinx.com, hare@suse.com, qemu-block@nongnu.org, david@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, marcandre.lureau@redhat.com, rth@twiddle.net, thuth@redhat.com, ehabkost@redhat.com, alistair@alistair23.me, qemu-s390x@nongnu.org, qemu-arm@nongnu.org, clg@kaod.org, jsnow@redhat.com, david@gibson.dropbear.id.au, Damien Hedde , berrange@redhat.com, cohuck@redhat.com, mark.burton@greensocs.com, qemu-ppc@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Provide a temporary function doing what device_reset does to do the transition with Resettable API which will trigger a prototype change of device_reset. Signed-off-by: Damien Hedde Reviewed-by: Peter Maydell --- hw/core/qdev.c | 6 +++--- include/hw/qdev-core.h | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 94ebc0a4a1..043e058396 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -256,7 +256,7 @@ HotplugHandler *qdev_get_hotplug_handler(DeviceState *d= ev) =20 static int qdev_reset_one(DeviceState *dev, void *opaque) { - device_reset(dev); + device_legacy_reset(dev); =20 return 0; } @@ -864,7 +864,7 @@ static void device_set_realized(Object *obj, bool value= , Error **errp) } } if (dev->hotplugged) { - device_reset(dev); + device_legacy_reset(dev); } dev->pending_deleted_event =3D false; =20 @@ -1086,7 +1086,7 @@ void device_class_set_parent_unrealize(DeviceClass *d= c, dc->unrealize =3D dev_unrealize; } =20 -void device_reset(DeviceState *dev) +void device_legacy_reset(DeviceState *dev) { DeviceClass *klass =3D DEVICE_GET_CLASS(dev); =20 diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index e157fc4acd..690ce72433 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -407,11 +407,16 @@ char *qdev_get_own_fw_dev_path_from_handler(BusState = *bus, DeviceState *dev); void qdev_machine_init(void); =20 /** - * @device_reset + * device_legacy_reset: * * Reset a single device (by calling the reset method). */ -void device_reset(DeviceState *dev); +void device_legacy_reset(DeviceState *dev); + +static inline void device_reset(DeviceState *dev) +{ + device_legacy_reset(dev); +} =20 void device_class_set_parent_reset(DeviceClass *dc, DeviceReset dev_reset, --=20 2.22.0