Blob Blame Raw
From a46c2139b02581c6d2462bc131930847efea8335 Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Thu, 30 May 2019 04:37:27 +0100
Subject: [PATCH 6/8] vfio: Make vfio_get_region_info_cap public
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RH-Author: David Gibson <dgibson@redhat.com>
Message-id: <20190530043728.32575-6-dgibson@redhat.com>
Patchwork-id: 88420
O-Subject: [RHEL-8.1 qemu-kvm PATCH 5/6] vfio: Make vfio_get_region_info_cap public
Bugzilla: 1710662
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>

From: Alexey Kardashevskiy <aik@ozlabs.ru>

This makes vfio_get_region_info_cap() to be used in quirks.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Message-Id: <20190307050518.64968-3-aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 013002f0fbf62545c0f5ea4c5c2d554a85919647)

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1710662

Signed-off-by: David Gibson <dgibson@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
 hw/vfio/common.c              | 2 +-
 include/hw/vfio/vfio-common.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 3ab92bd..3dbccfc 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -706,7 +706,7 @@ static void vfio_listener_release(VFIOContainer *container)
     }
 }
 
-static struct vfio_info_cap_header *
+struct vfio_info_cap_header *
 vfio_get_region_info_cap(struct vfio_region_info *info, uint16_t id)
 {
     struct vfio_info_cap_header *hdr;
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 36ee657..7607be3 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -197,6 +197,8 @@ int vfio_get_region_info(VFIODevice *vbasedev, int index,
 int vfio_get_dev_region_info(VFIODevice *vbasedev, uint32_t type,
                              uint32_t subtype, struct vfio_region_info **info);
 bool vfio_has_region_cap(VFIODevice *vbasedev, int region, uint16_t cap_type);
+struct vfio_info_cap_header *
+vfio_get_region_info_cap(struct vfio_region_info *info, uint16_t id);
 #endif
 extern const MemoryListener vfio_prereg_listener;
 
-- 
1.8.3.1