vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

Make VFIOIOMMUClass::attach_device() and its wrapper function
vfio_attach_device() 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:
Zhenzhong Duan 2024-05-07 14:42:44 +08:00 committed by Cédric Le Goater
parent f3758413b7
commit b77548355a
9 changed files with 27 additions and 34 deletions

View file

@ -552,10 +552,9 @@ static int vfio_base_device_init(VFIODevice *vbasedev, Error **errp)
return ret;
}
ret = vfio_attach_device(vbasedev->name, vbasedev,
&address_space_memory, errp);
if (ret) {
return ret;
if (!vfio_attach_device(vbasedev->name, vbasedev,
&address_space_memory, errp)) {
return -EINVAL;
}
ret = vfio_populate_device(vbasedev, errp);