qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
@ 2013-01-10 14:40 Paolo Bonzini
  2013-01-16  4:52 ` mdroth
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Paolo Bonzini @ 2013-01-10 14:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: agraf, qemu-stable

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 <pbonzini@redhat.com>
---
 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;
+
+    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 = {
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
  2013-01-10 14:40 [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices Paolo Bonzini
@ 2013-01-16  4:52 ` mdroth
  2013-01-16  8:42   ` KONRAD Frédéric
  2013-01-16  5:27 ` Andreas Färber
  2013-01-19 14:10 ` Paolo Bonzini
  2 siblings, 1 reply; 9+ messages in thread
From: mdroth @ 2013-01-16  4:52 UTC (permalink / raw)
  To: aliguori; +Cc: pbonzini, qemu-stable, qemu-devel, agraf

On Thu, Jan 10, 2013 at 03:40:25PM +0100, Paolo Bonzini wrote:
> 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 <pbonzini@redhat.com>

Ping. This fix doesn't appear to be upstream yet and I'm also looking to get
this in for 1.3.1.

(hint: `patches search tag:unapplied to:qemu-stable` :)

> ---
>  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;
> +
> +    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 = {
> -- 
> 1.8.1
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
  2013-01-10 14:40 [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices Paolo Bonzini
  2013-01-16  4:52 ` mdroth
@ 2013-01-16  5:27 ` Andreas Färber
  2013-01-16 10:10   ` Paolo Bonzini
  2013-01-19 14:10 ` Paolo Bonzini
  2 siblings, 1 reply; 9+ messages in thread
From: Andreas Färber @ 2013-01-16  5:27 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Michael Roth, qemu-stable, qemu-devel, agraf

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 <pbonzini@redhat.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
  2013-01-16  4:52 ` mdroth
@ 2013-01-16  8:42   ` KONRAD Frédéric
  2013-01-16 10:09     ` Paolo Bonzini
  0 siblings, 1 reply; 9+ messages in thread
From: KONRAD Frédéric @ 2013-01-16  8:42 UTC (permalink / raw)
  To: mdroth
  Cc: aliguori, qemu-devel, Mark Burton, qemu-stable, agraf, pbonzini,
	Andreas Färber

On 16/01/2013 05:52, mdroth wrote:
> On Thu, Jan 10, 2013 at 03:40:25PM +0100, Paolo Bonzini wrote:
>> 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 <pbonzini@redhat.com>
Isn't this handled by virtio-refactoring ?

I mean if we have a virtio bus on this VirtIOS390Device like in this series:
http://www.mail-archive.com/qemu-devel@nongnu.org/msg149035.html

And make VirtIODevice an abstract device which connects on this bus we 
can reset it with the normal way ?
> Ping. This fix doesn't appear to be upstream yet and I'm also looking to get
> this in for 1.3.1.
>
> (hint: `patches search tag:unapplied to:qemu-stable` :)
>
>> ---
>>   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;
>> +
>> +    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 = {
>> -- 
>> 1.8.1
>>
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
  2013-01-16  8:42   ` KONRAD Frédéric
@ 2013-01-16 10:09     ` Paolo Bonzini
  0 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2013-01-16 10:09 UTC (permalink / raw)
  To: KONRAD Frédéric
  Cc: aliguori, mdroth, qemu-devel, Mark Burton, agraf, qemu-stable,
	Andreas Färber

Il 16/01/2013 09:42, KONRAD Frédéric ha scritto:
>>
>>> 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 <pbonzini@redhat.com>
> Isn't this handled by virtio-refactoring ?
> 
> I mean if we have a virtio bus on this VirtIOS390Device like in this
> series:
> http://www.mail-archive.com/qemu-devel@nongnu.org/msg149035.html

Well, not in 1.3.1. :)

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
  2013-01-16  5:27 ` Andreas Färber
@ 2013-01-16 10:10   ` Paolo Bonzini
  2013-01-16 10:31     ` Andreas Färber
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2013-01-16 10:10 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel, agraf, Michael Roth, qemu-stable

Il 16/01/2013 06:27, Andreas Färber ha scritto:
> 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 <pbonzini@redhat.com>
>> ---
>>  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?

True, but the file uses this convention throughout.

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
  2013-01-16 10:10   ` Paolo Bonzini
@ 2013-01-16 10:31     ` Andreas Färber
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Färber @ 2013-01-16 10:31 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, agraf, KONRAD Frédéric, Michael Roth,
	qemu-stable

Am 16.01.2013 11:10, schrieb Paolo Bonzini:
> Il 16/01/2013 06:27, Andreas Färber ha scritto:
>> 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 <pbonzini@redhat.com>
>>> ---
>>>  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?
> 
> True, but the file uses this convention throughout.

Then I'm beginning to understand why Fred's patchset is so large...

Andreas

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
  2013-01-10 14:40 [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices Paolo Bonzini
  2013-01-16  4:52 ` mdroth
  2013-01-16  5:27 ` Andreas Färber
@ 2013-01-19 14:10 ` Paolo Bonzini
  2013-01-19 14:20   ` Alexander Graf
  2 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2013-01-19 14:10 UTC (permalink / raw)
  To: agraf; +Cc: qemu-devel, qemu-stable

Il 10/01/2013 15:40, Paolo Bonzini ha scritto:
> 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 <pbonzini@redhat.com>
> ---
>  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;
> +
> +    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 = {
> 

Alex, you missed this.

Paolo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices
  2013-01-19 14:10 ` Paolo Bonzini
@ 2013-01-19 14:20   ` Alexander Graf
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Graf @ 2013-01-19 14:20 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-stable


On 19.01.2013, at 15:10, Paolo Bonzini wrote:

> Il 10/01/2013 15:40, Paolo Bonzini ha scritto:
>> 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 <pbonzini@redhat.com>
>> ---
>> 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;
>> +
>> +    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 = {
>> 
> 
> Alex, you missed this.

Yeah, sorry. It's not going to be my last s390 pull request before 1.4 :)


Alex

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-19 14:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-10 14:40 [Qemu-devel] [PATCH] virtio-s390: add a reset function to virtio-s390 devices Paolo Bonzini
2013-01-16  4:52 ` mdroth
2013-01-16  8:42   ` KONRAD Frédéric
2013-01-16 10:09     ` Paolo Bonzini
2013-01-16  5:27 ` Andreas Färber
2013-01-16 10:10   ` Paolo Bonzini
2013-01-16 10:31     ` Andreas Färber
2013-01-19 14:10 ` Paolo Bonzini
2013-01-19 14:20   ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).