mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
vfio/cpr: Make vfio_cpr_register_container() return bool
This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater <clg@redhat.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
45d0d8c404
commit
f38f5dd1d4
4 changed files with 5 additions and 7 deletions
|
@ -618,8 +618,7 @@ static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as,
|
||||||
goto free_container_exit;
|
goto free_container_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = vfio_cpr_register_container(bcontainer, errp);
|
if (!vfio_cpr_register_container(bcontainer, errp)) {
|
||||||
if (ret) {
|
|
||||||
goto free_container_exit;
|
goto free_container_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,12 @@ static int vfio_cpr_reboot_notifier(NotifierWithReturn *notifier,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int vfio_cpr_register_container(VFIOContainerBase *bcontainer, Error **errp)
|
bool vfio_cpr_register_container(VFIOContainerBase *bcontainer, Error **errp)
|
||||||
{
|
{
|
||||||
migration_add_notifier_mode(&bcontainer->cpr_reboot_notifier,
|
migration_add_notifier_mode(&bcontainer->cpr_reboot_notifier,
|
||||||
vfio_cpr_reboot_notifier,
|
vfio_cpr_reboot_notifier,
|
||||||
MIG_MODE_CPR_REBOOT);
|
MIG_MODE_CPR_REBOOT);
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vfio_cpr_unregister_container(VFIOContainerBase *bcontainer)
|
void vfio_cpr_unregister_container(VFIOContainerBase *bcontainer)
|
||||||
|
|
|
@ -396,8 +396,7 @@ found_container:
|
||||||
goto err_listener_register;
|
goto err_listener_register;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = vfio_cpr_register_container(bcontainer, errp);
|
if (!vfio_cpr_register_container(bcontainer, errp)) {
|
||||||
if (ret) {
|
|
||||||
goto err_listener_register;
|
goto err_listener_register;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ void vfio_detach_device(VFIODevice *vbasedev);
|
||||||
int vfio_kvm_device_add_fd(int fd, Error **errp);
|
int vfio_kvm_device_add_fd(int fd, Error **errp);
|
||||||
int vfio_kvm_device_del_fd(int fd, Error **errp);
|
int vfio_kvm_device_del_fd(int fd, Error **errp);
|
||||||
|
|
||||||
int vfio_cpr_register_container(VFIOContainerBase *bcontainer, Error **errp);
|
bool vfio_cpr_register_container(VFIOContainerBase *bcontainer, Error **errp);
|
||||||
void vfio_cpr_unregister_container(VFIOContainerBase *bcontainer);
|
void vfio_cpr_unregister_container(VFIOContainerBase *bcontainer);
|
||||||
|
|
||||||
extern const MemoryRegionOps vfio_region_ops;
|
extern const MemoryRegionOps vfio_region_ops;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue