From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkydB-0004tt-0d for qemu-devel@nongnu.org; Tue, 18 Dec 2012 09:58:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tkyd9-00053q-Kr for qemu-devel@nongnu.org; Tue, 18 Dec 2012 09:58:52 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:58027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tkyd9-00053e-CV for qemu-devel@nongnu.org; Tue, 18 Dec 2012 09:58:51 -0500 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 18 Dec 2012 14:58:25 -0000 Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qBIEwb133539336 for ; Tue, 18 Dec 2012 14:58:37 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qBIE8PfN025887 for ; Tue, 18 Dec 2012 09:08:25 -0500 Date: Tue, 18 Dec 2012 15:58:42 +0100 From: Cornelia Huck Message-ID: <20121218155842.5ac3c4ee@gondolin> In-Reply-To: <50D02D27.6070604@redhat.com> References: <1346771633-53081-1-git-send-email-cornelia.huck@de.ibm.com> <1346771633-53081-4-git-send-email-cornelia.huck@de.ibm.com> <50D02D27.6070604@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 3/5] s390: Add new channel I/O based virtio transport. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: linux-s390 , Anthony Liguori , Rusty Russell , KVM , Carsten Otte , Sebastian Ott , Marcelo Tosatti , Heiko Carstens , qemu-devel , Alexander Graf , Christian Borntraeger , Avi Kivity , Martin Schwidefsky On Tue, 18 Dec 2012 09:45:27 +0100 Paolo Bonzini wrote: > Il 04/09/2012 17:13, Cornelia Huck ha scritto: > > +VirtioCcwBus *virtio_ccw_bus_init(void) > > +{ > > + VirtioCcwBus *cbus; > > + BusState *bus; > > + DeviceState *dev; > > + > > + /* Create bridge device */ > > + dev = qdev_create(NULL, "virtio-ccw-bridge"); > > + qdev_init_nofail(dev); > > + > > + /* Create bus on bridge device */ > > + bus = qbus_create(TYPE_VIRTIO_CCW_BUS, dev, "virtio-ccw"); > > + cbus = DO_UPCAST(VirtioCcwBus, bus, bus); > > + > > + /* Enable hotplugging */ > > + bus->allow_hotplug = 1; > > + > > + qemu_register_reset(virtio_ccw_reset_subchannels, cbus); > > Please use qdev device-reset and bus-reset callbacks instead of this. Will do for the next version. > > In particular, when writing the status you should call > qdev_reset_all(DEVICE(sch)), and whatever state should be reset will > have to be cleared by the device-reset callback of SubchDev, including > calling virtio_reset. With "writing the status" you mean "the guest sets the status to 0", right? > > Everything else will be cleared instead by the bus-reset callback of > virtio-ccw-bus, similar to what you are doing in > virtio_ccw_reset_subchannels. Looking at the reset handler, css_reset() is a bit oddly placed, as it doesn't really have anything to do with virtio-ccw; virtio-ccw is just the only current creator of channel subsystem images. I'll try to come up with a better model. > > Paolo > > > > + return cbus; > > +} >