qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Farman <farman@linux.ibm.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
	qemu-s390x@nongnu.org,
	Alex Williamson <alex.williamson@redhat.com>,
	David Hildenbrand <david@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>
Subject: Re: [PATCH v3 3/6] hw/vfio/ccw: Use intermediate S390CCWDevice variable
Date: Mon, 13 Feb 2023 13:40:10 -0500	[thread overview]
Message-ID: <b886f59f5b97e41036faeea7b7b3675a68e1b489.camel@linux.ibm.com> (raw)
In-Reply-To: <20230213170145.45666-4-philmd@linaro.org>

On Mon, 2023-02-13 at 18:01 +0100, Philippe Mathieu-Daudé wrote:
> 'cdev' is VFIOCCWDevice's private parent object.
> Access it using the S390_CCW_DEVICE() QOM macro.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Eric Farman <farman@linux.ibm.com>

> ---
>  hw/vfio/ccw.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
> index 503de94ce1..2c20e3c202 100644
> --- a/hw/vfio/ccw.c
> +++ b/hw/vfio/ccw.c
> @@ -588,9 +588,10 @@ static void vfio_ccw_put_device(VFIOCCWDevice
> *vcdev)
>  static void vfio_ccw_get_device(VFIOGroup *group, VFIOCCWDevice
> *vcdev,
>                                  Error **errp)
>  {
> -    char *name = g_strdup_printf("%x.%x.%04x", vcdev-
> >cdev.hostid.cssid,
> -                                 vcdev->cdev.hostid.ssid,
> -                                 vcdev->cdev.hostid.devid);
> +    S390CCWDevice *cdev = S390_CCW_DEVICE(vcdev);
> +    char *name = g_strdup_printf("%x.%x.%04x", cdev->hostid.cssid,
> +                                 cdev->hostid.ssid,
> +                                 cdev->hostid.devid);
>      VFIODevice *vbasedev;
>  
>      QLIST_FOREACH(vbasedev, &group->device_list, next) {
> @@ -611,7 +612,7 @@ static void vfio_ccw_get_device(VFIOGroup *group,
> VFIOCCWDevice *vcdev,
>       */
>      vcdev->vdev.ram_block_discard_allowed = true;
>  
> -    if (vfio_get_device(group, vcdev->cdev.mdevid, &vcdev->vdev,
> errp)) {
> +    if (vfio_get_device(group, cdev->mdevid, &vcdev->vdev, errp)) {
>          goto out_err;
>      }
>  


  reply	other threads:[~2023-02-13 18:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 17:01 [PATCH v3 0/6] hw/vfio/ccw: hw: Use QOM macros and remove DO_UPCAST() uses Philippe Mathieu-Daudé
2023-02-13 17:01 ` [PATCH v3 1/6] hw/s390x/event-facility: Replace DO_UPCAST(SCLPEvent) by SCLP_EVENT() Philippe Mathieu-Daudé
2023-02-13 17:01 ` [PATCH v3 2/6] hw/vfio/ccw: Simplify using DEVICE() macro Philippe Mathieu-Daudé
2023-02-13 18:38   ` Eric Farman
2023-02-13 17:01 ` [PATCH v3 3/6] hw/vfio/ccw: Use intermediate S390CCWDevice variable Philippe Mathieu-Daudé
2023-02-13 18:40   ` Eric Farman [this message]
2023-02-13 17:01 ` [PATCH v3 4/6] hw/vfio/ccw: Replace DO_UPCAST(S390CCWDevice) by S390_CCW_DEVICE() Philippe Mathieu-Daudé
2023-02-13 17:05   ` Philippe Mathieu-Daudé
2023-02-16 14:18   ` Thomas Huth
2023-02-13 17:01 ` [PATCH v3 5/6] hw/vfio/ccw: Remove pointless S390CCWDevice variable Philippe Mathieu-Daudé
2023-02-13 18:40   ` Eric Farman
2023-02-13 17:01 ` [PATCH v3 6/6] hw/vfio/ccw: Replace DO_UPCAST(VFIOCCWDevice) by VFIO_CCW() Philippe Mathieu-Daudé
2023-02-27 11:15 ` [PATCH v3 0/6] hw/vfio/ccw: hw: Use QOM macros and remove DO_UPCAST() uses Philippe Mathieu-Daudé
2023-02-27 11:46   ` Thomas Huth
2023-02-27 12:30     ` Philippe Mathieu-Daudé

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=b886f59f5b97e41036faeea7b7b3675a68e1b489.camel@linux.ibm.com \
    --to=farman@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=iii@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --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 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).