diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-07-18 16:43:47 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-07-18 16:43:47 +0100 |
commit | 9d836fc552cce747a0946473726ff25262130351 (patch) | |
tree | 31bbc5b80f1a214065fe165c80db9434c556d799 /hw | |
parent | 368e708b4c95501574ab11632c7a0b8bb3ddc7e8 (diff) | |
parent | 8c37faa475f35d158622422788fe8e5aef3118e1 (diff) | |
download | qemu-9d836fc552cce747a0946473726ff25262130351.zip |
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20170717.0' into staging
VFIO fixes 2017-07-17
- Init re-order to better support hot-add on SPAR (Alexey Kardashevskiy)
# gpg: Signature made Mon 17 Jul 2017 21:33:01 BST
# gpg: using RSA key 0x239B9B6E3BB08B22
# gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
# gpg: aka "Alex Williamson <alex@shazbot.org>"
# gpg: aka "Alex Williamson <alwillia@redhat.com>"
# gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B 8A90 239B 9B6E 3BB0 8B22
* remotes/awilliam/tags/vfio-updates-20170717.0:
vfio-pci, ppc64/spapr: Reorder group-to-container attaching
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/vfio/common.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index c1bb6d429a..7b2924c0ef 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1109,6 +1109,14 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as, goto free_container_exit; } + vfio_kvm_device_add_group(group); + + QLIST_INIT(&container->group_list); + QLIST_INSERT_HEAD(&space->containers, container, next); + + group->container = container; + QLIST_INSERT_HEAD(&container->group_list, group, container_next); + container->listener = vfio_memory_listener; memory_listener_register(&container->listener, container->space->as); @@ -1122,14 +1130,11 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as, container->initialized = true; - QLIST_INIT(&container->group_list); - QLIST_INSERT_HEAD(&space->containers, container, next); - - group->container = container; - QLIST_INSERT_HEAD(&container->group_list, group, container_next); - return 0; listener_release_exit: + QLIST_REMOVE(group, container_next); + QLIST_REMOVE(container, next); + vfio_kvm_device_del_group(group); vfio_listener_release(container); free_container_exit: @@ -1234,8 +1239,6 @@ VFIOGroup *vfio_get_group(int groupid, AddressSpace *as, Error **errp) QLIST_INSERT_HEAD(&vfio_group_list, group, next); - vfio_kvm_device_add_group(group); - return group; close_fd_exit: |