qemu-e2k/backends
Zhao Liu c1cccad865 backends/iommufd: Fix missing ERRP_GUARD() for error_prepend()
As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The iommufd_backend_set_fd() passes @errp to error_prepend(), to avoid
the above issue, add missing ERRP_GUARD() at the beginning of this
function.

[1]: Issue description in the commit message of commit ae7c80a7bd
     ("error: New macro ERRP_GUARD()").

Cc: Yi Liu <yi.l.liu@intel.com>
Cc: Eric Auger <eric.auger@redhat.com>
Cc: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-ID: <20240311033822.3142585-3-zhao1.liu@linux.intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-03-12 11:45:33 +01:00
..
tpm migration 1st pull for 9.0 2024-01-05 13:35:25 +00:00
confidential-guest-support.c
cryptodev-builtin.c cryptodev: Use CryptoDevBackendOpInfo for operation 2023-03-07 12:38:59 -05:00
cryptodev-hmp-cmds.c hmp: add cryptodev info command 2023-03-07 12:38:59 -05:00
cryptodev-lkcf.c cryptodev: Use CryptoDevBackendOpInfo for operation 2023-03-07 12:38:59 -05:00
cryptodev-vhost-user.c cryptodev-vhost-user: add asymmetric crypto support 2023-06-23 02:54:44 -04:00
cryptodev-vhost.c cryptodev: Introduce cryptodev.json 2023-03-07 12:38:59 -05:00
cryptodev.c backends/cryptodev: Do not ignore throttle/backends Errors 2024-01-19 12:28:59 +01:00
dbus-vmstate1.xml
dbus-vmstate.c backends: Constify VMState 2023-12-30 07:38:06 +11:00
hostmem-epc.c backends: Have HostMemoryBackendClass::alloc() handler return a boolean 2024-01-05 16:20:15 +01:00
hostmem-file.c backends: Have HostMemoryBackendClass::alloc() handler return a boolean 2024-01-05 16:20:15 +01:00
hostmem-memfd.c backends: Have HostMemoryBackendClass::alloc() handler return a boolean 2024-01-05 16:20:15 +01:00
hostmem-ram.c backends: Have HostMemoryBackendClass::alloc() handler return a boolean 2024-01-05 16:20:15 +01:00
hostmem.c oslib-posix: initialize backend memory objects in parallel 2024-02-06 08:15:22 +01:00
iommufd.c backends/iommufd: Fix missing ERRP_GUARD() for error_prepend() 2024-03-12 11:45:33 +01:00
Kconfig backends/iommufd: Introduce the iommufd object 2023-12-19 19:03:38 +01:00
meson.build configure, meson: rename targetos to host_os 2023-12-31 09:11:29 +01:00
rng-builtin.c
rng-egd.c backends: Improve error messages when property can no longer be set 2022-10-27 07:56:56 +02:00
rng-random.c backends: Improve error messages when property can no longer be set 2022-10-27 07:56:56 +02:00
rng.c error: Drop superfluous #include "qapi/qmp/qerror.h" 2023-02-23 13:56:14 +01:00
trace-events backends/iommufd: Introduce the iommufd object 2023-12-19 19:03:38 +01:00
trace.h
vhost-user.c backends/vhost-user: remove the ioeventfd check 2023-03-02 03:10:47 -05:00