From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtMxH-0000ME-Tm for qemu-devel@nongnu.org; Thu, 10 Jan 2013 13:34:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtMxG-0001Eh-AR for qemu-devel@nongnu.org; Thu, 10 Jan 2013 13:34:19 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55292 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtMxF-0001ET-VE for qemu-devel@nongnu.org; Thu, 10 Jan 2013 13:34:18 -0500 Message-ID: <50EF09A4.4010608@suse.de> Date: Thu, 10 Jan 2013 19:34:12 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1357829348-3496-1-git-send-email-pbonzini@redhat.com> <1357829348-3496-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1357829348-3496-2-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] qdev: add qbus_reset_all List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, mst@redhat.com Am 10.01.2013 15:49, schrieb Paolo Bonzini: > Signed-off-by: Paolo Bonzini > --- > hw/qdev-core.h | 12 ++++++++++++ > hw/qdev.c | 7 ++++++- > 2 files changed, 18 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/qdev-core.h b/hw/qdev-core.h > index fdf14ec..853bd08 100644 > --- a/hw/qdev-core.h > +++ b/hw/qdev-core.h > @@ -182,6 +182,18 @@ int qbus_walk_children(BusState *bus, qdev_walkerf= n *devfn, > int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn, > qbus_walkerfn *busfn, void *opaque); > void qdev_reset_all(DeviceState *dev); > + > +/** > + * @qbus_reset_all: Just " * qbus_reset_all:" please. > + * @bus: Bus to be reset. > + * > + * Reset @bus and perform a bus-level ("hard") reset of all devices co= nnected > + * to it, including recursive processing of all buses below @bus itsel= f. A > + * hard reset means that qbus_reset_all will reset all state of the de= vice. qbus_reset_all()? > + * For PCI devices, for example, this will include the base address re= gisters #PCIDevice? > + * or configuration space. > + */ > +void qbus_reset_all(BusState *bus); Otherwise looks trivial and okay. Andreas > void qbus_reset_all_fn(void *opaque); > =20 > void qbus_free(BusState *bus); > diff --git a/hw/qdev.c b/hw/qdev.c > index f2c2484..e2f957e 100644 > --- a/hw/qdev.c > +++ b/hw/qdev.c > @@ -228,10 +228,15 @@ void qdev_reset_all(DeviceState *dev) > qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL); > } > =20 > +void qbus_reset_all(BusState *bus) > +{ > + qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL); > +} > + > void qbus_reset_all_fn(void *opaque) > { > BusState *bus =3D opaque; > - qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL); > + qbus_reset_all(bus); > } > =20 > /* can be used as ->unplug() callback for the simple cases */ --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg