From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qmnt1-0000B1-Ei for qemu-devel@nongnu.org; Fri, 29 Jul 2011 10:18:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qmnt0-00033g-9e for qemu-devel@nongnu.org; Fri, 29 Jul 2011 10:17:59 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:34771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qmnsz-00033V-Ua for qemu-devel@nongnu.org; Fri, 29 Jul 2011 10:17:58 -0400 Received: by gyg8 with SMTP id 8so3053510gyg.4 for ; Fri, 29 Jul 2011 07:17:56 -0700 (PDT) Message-ID: <4E32C10E.1010206@codemonkey.ws> Date: Fri, 29 Jul 2011 09:17:50 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E2C4DE1.6010002@web.de> <4E2C589C.8040101@web.de> In-Reply-To: <4E2C589C.8040101@web.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] qdev: Reset hot-plugged devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel , Gleb Natapov , Markus Armbruster On 07/24/2011 12:38 PM, Jan Kiszka wrote: > From: Jan Kiszka > > Device models rely on the core invoking their reset handlers after init. > We do this in the cold-plug case, but so far we miss this step after > hot-plug. > > Signed-off-by: Jan Kiszka Applied. Thanks. Regards, Anthony Liguori > --- > > Changes in v2: > - move reset to qdev_init in case the device is created by the > hot-plugged one (composed devices) > > hw/qdev.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/hw/qdev.c b/hw/qdev.c > index a0fcd06..b4ea8e1 100644 > --- a/hw/qdev.c > +++ b/hw/qdev.c > @@ -289,6 +289,9 @@ int qdev_init(DeviceState *dev) > dev->alias_required_for_version); > } > dev->state = DEV_STATE_INITIALIZED; > + if (dev->hotplugged&& dev->info->reset) { > + dev->info->reset(dev); > + } > return 0; > } >