Re: [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void.

2018-03-06 Thread Cornelia Huck
On Tue, 6 Mar 2018 23:40:18 +
nee  wrote:

> On Tue, Mar 6, 2018 at 2:40 PM, Cornelia Huck  wrote:
> > On Tue,  6 Mar 2018 10:07:21 +
> > Nia Alarie  wrote:
> >  
> >> Allows a branch to be removed - this function always returns 0.
> >>
> >> Signed-off-by: Nia Alarie 
> >> Reviewed-by: Christian Borntraeger 
> >> ---
> >>  hw/s390x/virtio-ccw.c | 6 +++---
> >>  hw/s390x/virtio-ccw.h | 2 +-
> >>  2 files changed, 4 insertions(+), 4 deletions(-)  
> >
> > While your patch is not wrong, I'd prefer to skip changing the exit
> > functions and convert virtio-ccw to unrealize instead.
> >
> > Should not be too hard; do you want to take a stab at it?  
> 
> Is there any difference in semantics between exit and unrealize aside
> from the arguments and return type?

In our case, it should be a simple transformation to the new functions.



Re: [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void.

2018-03-06 Thread nee
On Tue, Mar 6, 2018 at 2:40 PM, Cornelia Huck  wrote:
> On Tue,  6 Mar 2018 10:07:21 +
> Nia Alarie  wrote:
>
>> Allows a branch to be removed - this function always returns 0.
>>
>> Signed-off-by: Nia Alarie 
>> Reviewed-by: Christian Borntraeger 
>> ---
>>  hw/s390x/virtio-ccw.c | 6 +++---
>>  hw/s390x/virtio-ccw.h | 2 +-
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> While your patch is not wrong, I'd prefer to skip changing the exit
> functions and convert virtio-ccw to unrealize instead.
>
> Should not be too hard; do you want to take a stab at it?

Is there any difference in semantics between exit and unrealize aside
from the arguments and return type?



Re: [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void.

2018-03-06 Thread Cornelia Huck
On Tue,  6 Mar 2018 10:07:21 +
Nia Alarie  wrote:

> Allows a branch to be removed - this function always returns 0.
> 
> Signed-off-by: Nia Alarie 
> Reviewed-by: Christian Borntraeger 
> ---
>  hw/s390x/virtio-ccw.c | 6 +++---
>  hw/s390x/virtio-ccw.h | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)

While your patch is not wrong, I'd prefer to skip changing the exit
functions and convert virtio-ccw to unrealize instead.

Should not be too hard; do you want to take a stab at it?



[Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void.

2018-03-06 Thread Nia Alarie
Allows a branch to be removed - this function always returns 0.

Signed-off-by: Nia Alarie 
Reviewed-by: Christian Borntraeger 
---
 hw/s390x/virtio-ccw.c | 6 +++---
 hw/s390x/virtio-ccw.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 8f7fbc2ab7..0773818a82 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -752,7 +752,7 @@ out_err:
 g_free(sch);
 }
 
-static int virtio_ccw_exit(VirtioCcwDevice *dev)
+static void virtio_ccw_exit(VirtioCcwDevice *dev)
 {
 CcwDevice *ccw_dev = CCW_DEVICE(dev);
 SubchDev *sch = ccw_dev->sch;
@@ -765,7 +765,6 @@ static int virtio_ccw_exit(VirtioCcwDevice *dev)
 release_indicator(>routes.adapter, dev->indicators);
 dev->indicators = NULL;
 }
-return 0;
 }
 
 static void virtio_ccw_net_realize(VirtioCcwDevice *ccw_dev, Error **errp)
@@ -1710,7 +1709,8 @@ static int virtio_ccw_busdev_exit(DeviceState *dev)
 VirtioCcwDevice *_dev = (VirtioCcwDevice *)dev;
 VirtIOCCWDeviceClass *_info = VIRTIO_CCW_DEVICE_GET_CLASS(dev);
 
-return _info->exit(_dev);
+_info->exit(_dev);
+return 0;
 }
 
 static void virtio_ccw_busdev_unplug(HotplugHandler *hotplug_dev,
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index 3905f3a3d6..8ffe7fe095 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -76,7 +76,7 @@ typedef struct VirtioCcwDevice VirtioCcwDevice;
 typedef struct VirtIOCCWDeviceClass {
 CCWDeviceClass parent_class;
 void (*realize)(VirtioCcwDevice *dev, Error **errp);
-int (*exit)(VirtioCcwDevice *dev);
+void (*exit)(VirtioCcwDevice *dev);
 } VirtIOCCWDeviceClass;
 
 /* Performance improves when virtqueue kick processing is decoupled from the
-- 
2.16.2