[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/33] hw/vfio/ccw: Use intermediate S390CCWDevice variable
From: |
Thomas Huth |
Subject: |
[PULL 04/33] hw/vfio/ccw: Use intermediate S390CCWDevice variable |
Date: |
Mon, 27 Feb 2023 12:35:52 +0100 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
'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>
Message-Id: <20230213170145.45666-4-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.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;
}
--
2.31.1
- [PULL 00/33] s390x and testing related patches, Thomas Huth, 2023/02/27
- [PULL 03/33] hw/vfio/ccw: Simplify using DEVICE() macro, Thomas Huth, 2023/02/27
- [PULL 02/33] Do not include hw/hw.h if it is not necessary, Thomas Huth, 2023/02/27
- [PULL 05/33] hw/vfio/ccw: Replace DO_UPCAST(S390CCWDevice) by S390_CCW_DEVICE(), Thomas Huth, 2023/02/27
- [PULL 06/33] hw/vfio/ccw: Remove pointless S390CCWDevice variable, Thomas Huth, 2023/02/27
- [PULL 04/33] hw/vfio/ccw: Use intermediate S390CCWDevice variable,
Thomas Huth <=
- [PULL 01/33] tests/qtest/rtl8139-test: Make the test less verbose by default, Thomas Huth, 2023/02/27
- [PULL 07/33] hw/vfio/ccw: Replace DO_UPCAST(VFIOCCWDevice) by VFIO_CCW(), Thomas Huth, 2023/02/27
- [PULL 08/33] target/s390x/arch_dump: Fix memory corruption in s390x_write_elf64_notes(), Thomas Huth, 2023/02/27
- [PULL 09/33] target/s390x/arch_dump: Simplify memory allocation in s390x_write_elf64_notes(), Thomas Huth, 2023/02/27
- [PULL 12/33] target/s390x: Use void* for haddr in S390Access, Thomas Huth, 2023/02/27
- [PULL 14/33] target/s390x: Remove TLB_NOTDIRTY workarounds, Thomas Huth, 2023/02/27
- [PULL 13/33] target/s390x: Tidy access_prepare_nf, Thomas Huth, 2023/02/27
- [PULL 10/33] target/s390x: Fix s390_probe_access for user-only, Thomas Huth, 2023/02/27
- [PULL 11/33] target/s390x: Pass S390Access pointer into access_prepare, Thomas Huth, 2023/02/27
- [PULL 15/33] target/s390x: Inline do_access_{get,set}_byte, Thomas Huth, 2023/02/27