aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2024-05-07 14:42:52 +0800
committerCédric Le Goater <clg@redhat.com>2024-05-16 16:59:20 +0200
commit9067d50dff29b1b96ef0d4ab7448dbd7b636e55c (patch)
treeccf0d91fce85d2947a434774ac9e764191d18350 /hw/vfio
parentf38f5dd1d454e41def9cdba899d0b059dd8855d9 (diff)
downloadqemu-9067d50dff29b1b96ef0d4ab7448dbd7b636e55c.zip
qemu-9067d50dff29b1b96ef0d4ab7448dbd7b636e55c.tar.gz
qemu-9067d50dff29b1b96ef0d4ab7448dbd7b636e55c.tar.bz2
backends/iommufd: Make iommufd_backend_*() return bool
This is to follow the coding standand to return bool if 'Error **' is used to pass error. The changed functions include: iommufd_backend_connect iommufd_backend_alloc_ioas By this chance, simplify the functions a bit by avoiding duplicate recordings, e.g., log through either error interface or trace, not both. 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>
Diffstat (limited to 'hw/vfio')
-rw-r--r--hw/vfio/iommufd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index 6a446b1..554f9a6 100644
--- a/hw/vfio/iommufd.c
+++ b/hw/vfio/iommufd.c
@@ -71,7 +71,7 @@ static bool iommufd_cdev_connect_and_bind(VFIODevice *vbasedev, Error **errp)
.flags = 0,
};
- if (iommufd_backend_connect(iommufd, errp)) {
+ if (!iommufd_backend_connect(iommufd, errp)) {
return false;
}
@@ -346,8 +346,7 @@ static bool iommufd_cdev_attach(const char *name, VFIODevice *vbasedev,
}
/* Need to allocate a new dedicated container */
- ret = iommufd_backend_alloc_ioas(vbasedev->iommufd, &ioas_id, errp);
- if (ret < 0) {
+ if (!iommufd_backend_alloc_ioas(vbasedev->iommufd, &ioas_id, errp)) {
goto err_alloc_ioas;
}