* [Qemu-devel] [PATCH v3 1/2] s390x/sclpconsole: Remove dead code - remove exit handlers
@ 2018-03-06 10:07 Nia Alarie
2018-03-06 10:07 ` [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void Nia Alarie
2018-03-06 14:38 ` [Qemu-devel] [PATCH v3 1/2] s390x/sclpconsole: Remove dead code - remove exit handlers Cornelia Huck
0 siblings, 2 replies; 6+ messages in thread
From: Nia Alarie @ 2018-03-06 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-s390x, borntraeger, cohuck, rth, stefanha, jim, joel,
Nia Alarie
The other event handlers (quiesce and cpu) do not define these
handlers, and this one does nothing, so it can be removed.
Signed-off-by: Nia Alarie <nia.alarie@gmail.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
hw/char/sclpconsole-lm.c | 6 ------
hw/char/sclpconsole.c | 6 ------
hw/s390x/event-facility.c | 14 --------------
include/hw/s390x/event-facility.h | 1 -
4 files changed, 27 deletions(-)
diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index c500bdaf29..84efd8df73 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -318,11 +318,6 @@ static int console_init(SCLPEvent *event)
return 0;
}
-static int console_exit(SCLPEvent *event)
-{
- return 0;
-}
-
static void console_reset(DeviceState *dev)
{
SCLPEvent *event = SCLP_EVENT(dev);
@@ -349,7 +344,6 @@ static void console_class_init(ObjectClass *klass, void *data)
dc->reset = console_reset;
dc->vmsd = &vmstate_sclplmconsole;
ec->init = console_init;
- ec->exit = console_exit;
ec->get_send_mask = send_mask;
ec->get_receive_mask = receive_mask;
ec->can_handle_event = can_handle_event;
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index d0265dfa7a..e6ba0a46bd 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -246,11 +246,6 @@ static void console_reset(DeviceState *dev)
scon->notify = false;
}
-static int console_exit(SCLPEvent *event)
-{
- return 0;
-}
-
static Property console_properties[] = {
DEFINE_PROP_CHR("chardev", SCLPConsole, chr),
DEFINE_PROP_END_OF_LIST(),
@@ -265,7 +260,6 @@ static void console_class_init(ObjectClass *klass, void *data)
dc->reset = console_reset;
dc->vmsd = &vmstate_sclpconsole;
ec->init = console_init;
- ec->exit = console_exit;
ec->get_send_mask = send_mask;
ec->get_receive_mask = receive_mask;
ec->can_handle_event = can_handle_event;
diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 155a69467b..79de3c738f 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -431,26 +431,12 @@ static void event_realize(DeviceState *qdev, Error **errp)
}
}
-static void event_unrealize(DeviceState *qdev, Error **errp)
-{
- SCLPEvent *event = SCLP_EVENT(qdev);
- SCLPEventClass *child = SCLP_EVENT_GET_CLASS(event);
- if (child->exit) {
- int rc = child->exit(event);
- if (rc < 0) {
- error_setg(errp, "SCLP event exit failed.");
- return;
- }
- }
-}
-
static void event_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->bus_type = TYPE_SCLP_EVENTS_BUS;
dc->realize = event_realize;
- dc->unrealize = event_unrealize;
}
static const TypeInfo sclp_event_type_info = {
diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-facility.h
index 5119b9b7f0..b913f85edc 100644
--- a/include/hw/s390x/event-facility.h
+++ b/include/hw/s390x/event-facility.h
@@ -174,7 +174,6 @@ typedef struct SCLPEvent {
typedef struct SCLPEventClass {
DeviceClass parent_class;
int (*init)(SCLPEvent *event);
- int (*exit)(SCLPEvent *event);
/* get SCLP's send mask */
unsigned int (*get_send_mask)(void);
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void.
2018-03-06 10:07 [Qemu-devel] [PATCH v3 1/2] s390x/sclpconsole: Remove dead code - remove exit handlers Nia Alarie
@ 2018-03-06 10:07 ` Nia Alarie
2018-03-06 14:40 ` Cornelia Huck
2018-03-06 14:38 ` [Qemu-devel] [PATCH v3 1/2] s390x/sclpconsole: Remove dead code - remove exit handlers Cornelia Huck
1 sibling, 1 reply; 6+ messages in thread
From: Nia Alarie @ 2018-03-06 10:07 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-s390x, borntraeger, cohuck, rth, stefanha, jim, joel,
Nia Alarie
Allows a branch to be removed - this function always returns 0.
Signed-off-by: Nia Alarie <nia.alarie@gmail.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
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(&dev->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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3 1/2] s390x/sclpconsole: Remove dead code - remove exit handlers
2018-03-06 10:07 [Qemu-devel] [PATCH v3 1/2] s390x/sclpconsole: Remove dead code - remove exit handlers Nia Alarie
2018-03-06 10:07 ` [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void Nia Alarie
@ 2018-03-06 14:38 ` Cornelia Huck
1 sibling, 0 replies; 6+ messages in thread
From: Cornelia Huck @ 2018-03-06 14:38 UTC (permalink / raw)
To: Nia Alarie; +Cc: qemu-devel, qemu-s390x, borntraeger, rth, stefanha, jim, joel
On Tue, 6 Mar 2018 10:07:20 +0000
Nia Alarie <nia.alarie@gmail.com> wrote:
> The other event handlers (quiesce and cpu) do not define these
> handlers, and this one does nothing, so it can be removed.
>
> Signed-off-by: Nia Alarie <nia.alarie@gmail.com>
> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
> hw/char/sclpconsole-lm.c | 6 ------
> hw/char/sclpconsole.c | 6 ------
> hw/s390x/event-facility.c | 14 --------------
> include/hw/s390x/event-facility.h | 1 -
> 4 files changed, 27 deletions(-)
Thanks, applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void.
2018-03-06 10:07 ` [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void Nia Alarie
@ 2018-03-06 14:40 ` Cornelia Huck
2018-03-06 23:40 ` nee
0 siblings, 1 reply; 6+ messages in thread
From: Cornelia Huck @ 2018-03-06 14:40 UTC (permalink / raw)
To: Nia Alarie; +Cc: qemu-devel, qemu-s390x, borntraeger, rth, stefanha, jim, joel
On Tue, 6 Mar 2018 10:07:21 +0000
Nia Alarie <nia.alarie@gmail.com> wrote:
> Allows a branch to be removed - this function always returns 0.
>
> Signed-off-by: Nia Alarie <nia.alarie@gmail.com>
> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
> 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?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void.
2018-03-06 14:40 ` Cornelia Huck
@ 2018-03-06 23:40 ` nee
2018-03-07 7:33 ` Cornelia Huck
0 siblings, 1 reply; 6+ messages in thread
From: nee @ 2018-03-06 23:40 UTC (permalink / raw)
To: Cornelia Huck
Cc: qemu-devel, qemu-s390x, borntraeger, rth, Stefan Hajnoczi,
Jim Mussared, Joel Stanley
On Tue, Mar 6, 2018 at 2:40 PM, Cornelia Huck <cohuck@redhat.com> wrote:
> On Tue, 6 Mar 2018 10:07:21 +0000
> Nia Alarie <nia.alarie@gmail.com> wrote:
>
>> Allows a branch to be removed - this function always returns 0.
>>
>> Signed-off-by: Nia Alarie <nia.alarie@gmail.com>
>> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>> 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?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void.
2018-03-06 23:40 ` nee
@ 2018-03-07 7:33 ` Cornelia Huck
0 siblings, 0 replies; 6+ messages in thread
From: Cornelia Huck @ 2018-03-07 7:33 UTC (permalink / raw)
To: nee
Cc: qemu-devel, qemu-s390x, borntraeger, rth, Stefan Hajnoczi,
Jim Mussared, Joel Stanley
On Tue, 6 Mar 2018 23:40:18 +0000
nee <nia.alarie@gmail.com> wrote:
> On Tue, Mar 6, 2018 at 2:40 PM, Cornelia Huck <cohuck@redhat.com> wrote:
> > On Tue, 6 Mar 2018 10:07:21 +0000
> > Nia Alarie <nia.alarie@gmail.com> wrote:
> >
> >> Allows a branch to be removed - this function always returns 0.
> >>
> >> Signed-off-by: Nia Alarie <nia.alarie@gmail.com>
> >> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> >> ---
> >> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-03-07 7:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06 10:07 [Qemu-devel] [PATCH v3 1/2] s390x/sclpconsole: Remove dead code - remove exit handlers Nia Alarie
2018-03-06 10:07 ` [Qemu-devel] [PATCH v3 2/2] s390x: Change return type of virtio_ccw_exit to void Nia Alarie
2018-03-06 14:40 ` Cornelia Huck
2018-03-06 23:40 ` nee
2018-03-07 7:33 ` Cornelia Huck
2018-03-06 14:38 ` [Qemu-devel] [PATCH v3 1/2] s390x/sclpconsole: Remove dead code - remove exit handlers Cornelia Huck
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).