Received: from eggs.gnu.org ([2001:4830:134:3::10]:44219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXB0g-000751-Da for qemu-devel@nongnu.org; Thu, 25 Sep 2014 11:31:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXB0a-000591-7y for qemu-devel@nongnu.org; Thu, 25 Sep 2014 11:31:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXB0Z-00057m-Qu for qemu-devel@nongnu.org; Thu, 25 Sep 2014 11:31:04 -0400 Date: Thu, 25 Sep 2014 17:26:11 +0200 From: Igor Mammedov Message-ID: <20140925172611.17156a05@nial.usersys.redhat.com> In-Reply-To: <20140925163237.771069ca.cornelia.huck@de.ibm.com> References: <1411559299-19042-1-git-send-email-imammedo@redhat.com> <1411559299-19042-21-git-send-email-imammedo@redhat.com> <20140925130838.492d655d.cornelia.huck@de.ibm.com> <20140925151110.250dccd8@nial.usersys.redhat.com> <20140925163237.771069ca.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 20/30] s390x: convert virtio-ccw to hotplug handler API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: dmitry@daynix.com, mst@redhat.com, agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, kraxel@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, rth@twiddle.net On Thu, 25 Sep 2014 16:32:37 +0200 Cornelia Huck wrote: > On Thu, 25 Sep 2014 15:11:10 +0200 > Igor Mammedov wrote: > > > On Thu, 25 Sep 2014 13:08:38 +0200 > > Cornelia Huck wrote: > > > > So, to summarize, what happened before was > > > > > > bridge device <--- (simple unplug invoked for dev) > > simple unplug should not exits for above device > > Yes. I'm not sure why it does. > > > > > > -> virtual bus > > > -> virtio proxy device <--- virtio unplug invoked for dev > > > > > -> virtio bus > > > -> virtio device > > > > > > which your patch changed to > > > > > > bridge device > > > -> virtual bus <--- simple unplug invoked for virtio proxy dev > > > -> virtio proxy device > > > -> virtio bus <--- (virtio unplug invoked for virtio dev) > > > -> virtio device > > > > > > Am I understanding this correctly? > > Let's try other way around: > > > > bridge device (virtual_css_bridge) - non hotpluggable sysbus device > > -> virtual bus (VIRTUAL_CSS_BUS) > > -> virtio proxy device | > > -> virtio bus |- virtio_ccw_device_foo composite device managed with > > -> virtio device | device_add/del command > > > > internal "virtio device" is the only child of "virtio bus" and it's not supposed > > to be managed via device_add/del. > > This makes sense; I'm wondering why virtio-bus had allow_hotplug set > before, though. it was due to behavior of bus_add_child() which required bus to be hotplugggable. > > > > > So to unplug "virtio proxy device" we should call virtio_ccw_busdev_unplug > > stored in "bridge device" with "virtual bus" using bridge as hotplug-handler. > > > > does following patch work for you? > > It does react as expected with a simple device_add/device_del (your > patches applied up to patch 19 with this one on top). Thanks for confirmation, I'll amend s390-virtio in similar manner for V2