You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/hw/cxl
Markus Armbruster b8df7dfc04 hw/cxl: Convert cxl_fmws_link() to Error
Functions that use an Error **errp parameter to return errors should
not also report them to the user, because reporting is the caller's
job.  When the caller does, the error is reported twice.  When it
doesn't (because it recovered from the error), there is no error to
report, i.e. the report is bogus.

cxl_fmws_link_targets() violates this principle: it calls
error_setg(&error_fatal, ...) via cxl_fmws_link().  Goes back to
commit 584f722eb3 (hw/cxl: Make the CXL fixed memory windows
devices.)  Currently harmless, because cxl_fmws_link_targets()'s
callers always pass &error_fatal.  Clean this up by converting
cxl_fmws_link() to Error.

Also change its return value on error from 1 to -1 to conform to the
rules laid in qapi/error.h.  It's call chain cxl_fmws_link_targets()
via object_child_foreach_recursive() is fine with that.

Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250923091000.3180122-4-armbru@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
3 weeks ago
..
Kconfig
cxl-cdat.c hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean 2 years ago
cxl-component-utils.c mem/cxl_type3: support 3, 6, 12 and 16 interleave ways 8 months ago
cxl-device-utils.c hw/cxl: Support aborting background commands 5 months ago
cxl-events.c hw/cxl: Create helper function to create DC Event Records from extents 3 months ago
cxl-host-stubs.c hw/cxl: Make the CXL fixed memory windows devices. 4 months ago
cxl-host.c hw/cxl: Convert cxl_fmws_link() to Error 3 weeks ago
cxl-mailbox-utils.c hw/cxl: mailbox-utils: 0x5605 - FMAPI Initiate DC Release 3 months ago
meson.build meson: remove CONFIG_ALL 2 years ago
switch-mailbox-cci.c qom: Make InterfaceInfo[] uses const 6 months ago