qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Farhan Ali <alifm@linux.vnet.ibm.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Marcel Apfelbaum" <marcel@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>, Alexander Graf <agraf@suse.de>,
	qemu-devel@nongnu.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	"open list:virtio-ccw" <qemu-s390x@nongnu.org>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 05/11] virtio-ccw: convert VirtIOCCWDeviceClass::init -> realize
Date: Tue, 16 Jan 2018 11:11:35 -0500	[thread overview]
Message-ID: <f7b3af0e-832c-5f9f-b6c1-8f9d24780d3c@linux.vnet.ibm.com> (raw)
In-Reply-To: <18def10c-ca89-6628-34db-c62b071b3277@amsat.org>



On 01/16/2018 09:07 AM, Philippe Mathieu-Daudé wrote:
> On 01/16/2018 10:41 AM, Farhan Ali wrote:
>> shouldn't the commit message say exit -> unrealize?
> 
> Oops, indeed :|
> 
> Thanks :)
> 
> Phil.

Sure, you are welcome :)

With the change in commit message, the patch looks good to me:

Reviewed-by: Farhan Ali <alifm@linux.vnet.ibm.com>



> 
>>
>>
>> Thanks
>> Farhan
>>
>> On 01/16/2018 08:15 AM, Philippe Mathieu-Daudé wrote:
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>>    hw/s390x/virtio-ccw.h |  2 +-
>>>    hw/s390x/virtio-ccw.c | 35 +++++++++++++++++------------------
>>>    2 files changed, 18 insertions(+), 19 deletions(-)
>>>
>>> diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
>>> index 3905f3a3d6..2fc513001e 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 (*unrealize)(VirtioCcwDevice *dev, Error **errp);
>>>    } VirtIOCCWDeviceClass;
>>>
>>>    /* Performance improves when virtqueue kick processing is decoupled
>>> from the
>>> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
>>> index 38f6a8afc9..a71c3feeb5 100644
>>> --- a/hw/s390x/virtio-ccw.c
>>> +++ b/hw/s390x/virtio-ccw.c
>>> @@ -751,7 +751,7 @@ out_err:
>>>        g_free(sch);
>>>    }
>>>
>>> -static int virtio_ccw_exit(VirtioCcwDevice *dev)
>>> +static void virtio_ccw_unrealize(VirtioCcwDevice *dev, Error **errp)
>>>    {
>>>        CcwDevice *ccw_dev = CCW_DEVICE(dev);
>>>        SubchDev *sch = ccw_dev->sch;
>>> @@ -764,7 +764,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)
>>> @@ -1343,7 +1342,7 @@ static void
>>> virtio_ccw_net_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_net_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_net_properties;
>>>        set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);
>>> @@ -1371,7 +1370,7 @@ static void
>>> virtio_ccw_blk_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_blk_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_blk_properties;
>>>        set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
>>> @@ -1399,7 +1398,7 @@ static void
>>> virtio_ccw_serial_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_serial_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_serial_properties;
>>>        set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
>>> @@ -1427,7 +1426,7 @@ static void
>>> virtio_ccw_balloon_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_balloon_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_balloon_properties;
>>>        set_bit(DEVICE_CATEGORY_MISC, dc->categories);
>>> @@ -1455,7 +1454,7 @@ static void
>>> virtio_ccw_scsi_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_scsi_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_scsi_properties;
>>>        set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
>>> @@ -1482,7 +1481,7 @@ static void
>>> vhost_ccw_scsi_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = vhost_ccw_scsi_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = vhost_ccw_scsi_properties;
>>>        set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
>>> @@ -1519,7 +1518,7 @@ static void
>>> virtio_ccw_rng_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_rng_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_rng_properties;
>>>        set_bit(DEVICE_CATEGORY_MISC, dc->categories);
>>> @@ -1557,7 +1556,7 @@ static void
>>> virtio_ccw_crypto_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_crypto_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_crypto_properties;
>>>        set_bit(DEVICE_CATEGORY_MISC, dc->categories);
>>> @@ -1595,7 +1594,7 @@ static void
>>> virtio_ccw_gpu_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_gpu_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_gpu_properties;
>>>        dc->hotpluggable = false;
>>> @@ -1624,7 +1623,7 @@ static void
>>> virtio_ccw_input_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = virtio_ccw_input_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_input_properties;
>>>        set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
>>> @@ -1704,12 +1703,12 @@ static void
>>> virtio_ccw_busdev_realize(DeviceState *dev, Error **errp)
>>>        virtio_ccw_device_realize(_dev, errp);
>>>    }
>>>
>>> -static int virtio_ccw_busdev_exit(DeviceState *dev)
>>> +static void virtio_ccw_busdev_unrealize(DeviceState *dev, Error **errp)
>>>    {
>>>        VirtioCcwDevice *_dev = (VirtioCcwDevice *)dev;
>>> -    VirtIOCCWDeviceClass *_info = VIRTIO_CCW_DEVICE_GET_CLASS(dev);
>>> +    VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_GET_CLASS(dev);
>>>
>>> -    return _info->exit(_dev);
>>> +    k->unrealize(_dev, errp);
>>>    }
>>>
>>>    static void virtio_ccw_busdev_unplug(HotplugHandler *hotplug_dev,
>>> @@ -1727,7 +1726,7 @@ static void
>>> virtio_ccw_device_class_init(ObjectClass *klass, void *data)
>>>
>>>        k->unplug = virtio_ccw_busdev_unplug;
>>>        dc->realize = virtio_ccw_busdev_realize;
>>> -    dc->exit = virtio_ccw_busdev_exit;
>>> +    dc->unrealize = virtio_ccw_busdev_unrealize;
>>>        dc->bus_type = TYPE_VIRTUAL_CSS_BUS;
>>>    }
>>>
>>> @@ -1803,7 +1802,7 @@ static void virtio_ccw_9p_class_init(ObjectClass
>>> *klass, void *data)
>>>        DeviceClass *dc = DEVICE_CLASS(klass);
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        k->realize = virtio_ccw_9p_realize;
>>>        dc->reset = virtio_ccw_reset;
>>>        dc->props = virtio_ccw_9p_properties;
>>> @@ -1852,7 +1851,7 @@ static void
>>> vhost_vsock_ccw_class_init(ObjectClass *klass, void *data)
>>>        VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
>>>
>>>        k->realize = vhost_vsock_ccw_realize;
>>> -    k->exit = virtio_ccw_exit;
>>> +    k->unrealize = virtio_ccw_unrealize;
>>>        set_bit(DEVICE_CATEGORY_MISC, dc->categories);
>>>        dc->props = vhost_vsock_ccw_properties;
>>>        dc->reset = virtio_ccw_reset;
>>>
>>
> 

  reply	other threads:[~2018-01-16 16:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 13:15 [Qemu-devel] [PATCH 00/11] qdev: remove DeviceClass::init/exit() Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 01/11] smbus: add a NULL check for SMBusDeviceClass::init callbacks Philippe Mathieu-Daudé
2018-01-19 17:58   ` Eduardo Habkost
2018-01-16 13:15 ` [Qemu-devel] [PATCH 02/11] smbus_eeprom: replace SMBusDeviceClass::init by DeviceClass::reset Philippe Mathieu-Daudé
2018-01-19 18:15   ` Eduardo Habkost
2018-01-19 21:41     ` Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 03/11] hw/i2c: convert I2CSlaveClass::init -> realize Philippe Mathieu-Daudé
2018-01-16 14:09   ` Philippe Mathieu-Daudé
2018-01-19 18:18   ` Eduardo Habkost
2018-01-19 18:53     ` Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 04/11] usb-ccid: convert CCIDCardClass::init " Philippe Mathieu-Daudé
2018-01-18 17:05   ` Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 05/11] virtio-ccw: convert VirtIOCCWDeviceClass::init " Philippe Mathieu-Daudé
2018-01-16 13:41   ` Farhan Ali
2018-01-16 14:07     ` Philippe Mathieu-Daudé
2018-01-16 16:11       ` Farhan Ali [this message]
2018-01-16 16:52   ` Cornelia Huck
2018-01-17 12:30     ` Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 06/11] sysbus: add realize() and unrealize() Philippe Mathieu-Daudé
2018-01-19 18:03   ` Eduardo Habkost
2018-01-19 19:03     ` Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 07/11] qdev: simplify the SysBusDeviceClass::init path Philippe Mathieu-Daudé
2018-01-19 18:24   ` Eduardo Habkost
2018-01-16 13:15 ` [Qemu-devel] [PATCH 08/11] qdev: remove DeviceClass::init Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 09/11] qdev: remove DeviceClass::exit Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 10/11] qdev: remove empty realize/unrealize stubs Philippe Mathieu-Daudé
2018-01-16 13:15 ` [Qemu-devel] [PATCH 11/11] qdev: rename typedef qdev_resetfn() -> DeviceReset() Philippe Mathieu-Daudé
2018-01-17  5:45 ` [Qemu-devel] [PATCH 00/11] qdev: remove DeviceClass::init/exit() no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7b3af0e-832c-5f9f-b6c1-8f9d24780d3c@linux.vnet.ibm.com \
    --to=alifm@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).