mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
vfio/container: Move listener to base container
Move listener to base container. Also error and initialized fields are moved at the same time. No functional change intended. Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
dc74a4b005
commit
c7b313d300
6 changed files with 74 additions and 73 deletions
|
@ -46,6 +46,7 @@ static void vfio_prereg_listener_region_add(MemoryListener *listener,
|
|||
{
|
||||
VFIOContainer *container = container_of(listener, VFIOContainer,
|
||||
prereg_listener);
|
||||
VFIOContainerBase *bcontainer = &container->bcontainer;
|
||||
const hwaddr gpa = section->offset_within_address_space;
|
||||
hwaddr end;
|
||||
int ret;
|
||||
|
@ -88,9 +89,9 @@ static void vfio_prereg_listener_region_add(MemoryListener *listener,
|
|||
* can gracefully fail. Runtime, there's not much we can do other
|
||||
* than throw a hardware error.
|
||||
*/
|
||||
if (!container->initialized) {
|
||||
if (!container->error) {
|
||||
error_setg_errno(&container->error, -ret,
|
||||
if (!bcontainer->initialized) {
|
||||
if (!bcontainer->error) {
|
||||
error_setg_errno(&bcontainer->error, -ret,
|
||||
"Memory registering failed");
|
||||
}
|
||||
} else {
|
||||
|
@ -445,9 +446,9 @@ int vfio_spapr_container_init(VFIOContainer *container, Error **errp)
|
|||
|
||||
memory_listener_register(&container->prereg_listener,
|
||||
&address_space_memory);
|
||||
if (container->error) {
|
||||
if (bcontainer->error) {
|
||||
ret = -1;
|
||||
error_propagate_prepend(errp, container->error,
|
||||
error_propagate_prepend(errp, bcontainer->error,
|
||||
"RAM memory listener initialization failed: ");
|
||||
goto listener_unregister_exit;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue