qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s39


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
Date: Wed, 16 Jan 2013 06:27:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 10.01.2013 15:40, schrieb Paolo Bonzini:
> virtio-s390 devices are not being reset when their bus is.  To fix
> this, add a reset method that forwards to virtio_reset.  This is
> only needed because of the "strange" modeling of virtio devices;
> the ->vdev link is being handled manually rather than through qdev.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  hw/s390-virtio-bus.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
> index 7e99175..1e3e4f0 100644
> --- a/hw/s390-virtio-bus.c
> +++ b/hw/s390-virtio-bus.c
> @@ -505,6 +505,13 @@ static int s390_virtio_busdev_init(DeviceState *dev)
>      return _info->init(_dev);
>  }
>  
> +static void s390_virtio_busdev_reset(DeviceState *dev)
> +{
> +    VirtIOS390Device *_dev = (VirtIOS390Device *)dev;

Underscore alert. ;) What about naming the arg d and the variable dev?

Andreas

> +
> +    virtio_reset(_dev->vdev);
> +}
> +
>  static void virtio_s390_device_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> @@ -512,6 +519,7 @@ static void virtio_s390_device_class_init(ObjectClass 
> *klass, void *data)
>      dc->init = s390_virtio_busdev_init;
>      dc->bus_type = TYPE_S390_VIRTIO_BUS;
>      dc->unplug = qdev_simple_unplug_cb;
> +    dc->reset = s390_virtio_busdev_reset;
>  }
>  
>  static TypeInfo virtio_s390_device_info = {

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]