[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v10 10/19] vfio: improve vfio_get_group to support add
From: |
Chen Fan |
Subject: |
[Qemu-devel] [RFC v10 10/19] vfio: improve vfio_get_group to support adding as is NULL. |
Date: |
Tue, 16 Jun 2015 16:10:54 +0800 |
Signed-off-by: Chen Fan <address@hidden>
---
hw/vfio/common.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index df3171d..15f19a2 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -808,11 +808,18 @@ VFIOGroup *vfio_get_group(int groupid, AddressSpace *as)
VFIOGroup *group;
char path[32];
struct vfio_group_status status = { .argsz = sizeof(status) };
+ int ret;
QLIST_FOREACH(group, &vfio_group_list, next) {
if (group->groupid == groupid) {
/* Found it. Now is it already in the right context? */
- if (group->container->space->as == as) {
+ if (as && !group->container->space->as) {
+ ret = vfio_register_container_listener(group->container, as);
+ if (ret) {
+ return NULL;
+ }
+ }
+ if (!as || group->container->space->as == as) {
group->ref++;
return group;
} else {
--
1.9.3
- [Qemu-devel] [RFC v10 00/19] vfio-pci: pass the aer error to guest, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 01/19] vfio: extract vfio_get_hot_reset_info as a single function, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 03/19] pcie: modify the capability size assert, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 02/19] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 04/19] vfio: make the 4 bytes aligned for capability size, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 06/19] aer: impove pcie_aer_init to support vfio device, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 08/19] vfio: add ref for group to support own affected groups, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 05/19] vfio: add pcie extanded capability support, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 10/19] vfio: improve vfio_get_group to support adding as is NULL.,
Chen Fan <=
- [Qemu-devel] [RFC v10 07/19] vfio: add aer support for vfio device, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 09/19] vfio: extract vfio_register_container_listener from vfio_connect_container, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 11/19] get all affected groups for each device support aer, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 12/19] vfio: add check host bus reset is support or not, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 14/19] vfio: add sec_bus_reset notifier to notify physical bus reset is needed, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 15/19] vfio: improve vfio_pci_hot_reset to support more case, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 16/19] vfio: do hot bus reset when do virtual secondary bus reset, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 17/19] pcie_aer: expose pcie_aer_msg() interface, Chen Fan, 2015/06/16