[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/5] s390: Add new channel I/O based virtio t
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/5] s390: Add new channel I/O based virtio transport. |
Date: |
Tue, 18 Dec 2012 16:01:34 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
Il 18/12/2012 15:58, Cornelia Huck ha scritto:
> On Tue, 18 Dec 2012 09:45:27 +0100
> Paolo Bonzini <address@hidden> 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?
Yes.
Paolo
>> 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;
>>> +}
>>
>