From: Cornelia Huck <cohuck@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: David Hildenbrand <david@redhat.com>,
qemu-s390x@nongnu.org,
Christian Borntraeger <borntraeger@de.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Alexander Graf <agraf@suse.de>,
Richard Henderson <rth@twiddle.net>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH v2] hw/s390x/virtio-ccw: Consolidate calls to virtio_ccw_unrealize()
Date: Tue, 24 Jul 2018 15:17:32 +0200 [thread overview]
Message-ID: <20180724151732.608d7183.cohuck@redhat.com> (raw)
In-Reply-To: <1532421839-24512-1-git-send-email-thuth@redhat.com>
On Tue, 24 Jul 2018 10:43:59 +0200
Thomas Huth <thuth@redhat.com> wrote:
> Currently, every virtio-ccw device explicitely sets its unrealize
> function to virtio_ccw_unrealize() in its class_init function.
> We can simplify this by using a common unrealize function, just like
> it is already done for the realize functions.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/s390x/virtio-ccw.c | 22 +++++++---------------
> 1 file changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
> index 7ddb378..f3ad7aa 100644
> --- a/hw/s390x/virtio-ccw.c
> +++ b/hw/s390x/virtio-ccw.c
> @@ -750,8 +750,9 @@ out_err:
> g_free(sch);
> }
>
> -static void virtio_ccw_unrealize(VirtioCcwDevice *dev, Error **errp)
> +static void virtio_ccw_device_unrealize(VirtioCcwDevice *dev, Error **errp)
> {
> + VirtIOCCWDeviceClass *dc = VIRTIO_CCW_DEVICE_GET_CLASS(dev);
> CcwDevice *ccw_dev = CCW_DEVICE(dev);
> SubchDev *sch = ccw_dev->sch;
>
> @@ -764,6 +765,10 @@ static void virtio_ccw_unrealize(VirtioCcwDevice *dev, Error **errp)
> release_indicator(&dev->routes.adapter, dev->indicators);
> dev->indicators = NULL;
> }
> +
> + if (dc->unrealize) {
> + dc->unrealize(dev, errp);
> + }
> }
>
Hm... if any device type should have the need to do something in the
unrealize path, it would probably want to do it before the common
unrealize handling, I think. For example, it might want a valid sch.
next prev parent reply other threads:[~2018-07-24 13:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 8:43 [Qemu-devel] [RFC PATCH v2] hw/s390x/virtio-ccw: Consolidate calls to virtio_ccw_unrealize() Thomas Huth
2018-07-24 13:17 ` Cornelia Huck [this message]
2018-07-24 13:30 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
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=20180724151732.608d7183.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.