[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/4] hw/s390x/virtio-ccw: Add virtio_ccw_device_
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH 1/4] hw/s390x/virtio-ccw: Add virtio_ccw_device_plugged for virtio-ccw |
Date: |
Fri, 17 Apr 2015 15:44:55 +0200 |
On Fri, 17 Apr 2015 20:13:43 +0800
Shannon Zhao <address@hidden> wrote:
> Add virtio_ccw_device_plugged, it can be used to get backend's features.
>
> Signed-off-by: Shannon Zhao <address@hidden>
> Signed-off-by: Shannon Zhao <address@hidden>
> ---
> hw/s390x/virtio-ccw.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
> index 130535c..30ca377 100644
> --- a/hw/s390x/virtio-ccw.c
> +++ b/hw/s390x/virtio-ccw.c
> @@ -1395,6 +1395,16 @@ static int virtio_ccw_load_config(DeviceState *d,
> QEMUFile *f)
> return 0;
> }
>
> +/* This is called by virtio-bus just after the device is plugged. */
> +static void virtio_ccw_device_plugged(DeviceState *d)
> +{
> + VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);
> +
> + /* Only the first 32 feature bits are used. */
> + dev->host_features[0] = virtio_bus_get_vdev_features(&dev->bus,
> +
> dev->host_features[0]);
> +}
> +
So how does this help? We already fetch the host features in the
realize function.
> /**************** Virtio-ccw Bus Device Descriptions *******************/
>
> static Property virtio_ccw_net_properties[] = {