qemu/hw/xen
Damien Hedde 4a1d937796 softmmu/qdev-monitor: add error handling in qdev_set_id
qdev_set_id() is mostly used when the user adds a device (using
-device cli option or device_add qmp command). This commit adds
an error parameter to handle the case where the given id is
already taken.

Also document the function and add a return value in order to
be able to capture success/failure: the function now returns the
id in case of success, or NULL in case of failure.

The commit modifies the 2 calling places (qdev-monitor and
xen-legacy-backend) to add the error object parameter.

Note that the id is, right now, guaranteed to be unique because
all ids came from the "device" QemuOptsList where the id is used
as key. This addition is a preparation for a future commit which
will relax the uniqueness.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-10-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-10-15 16:08:46 +02:00
..
meson.build meson: convert hw/xen 2020-08-21 06:30:24 -04:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
xen_devconfig.c
xen_pt_config_init.c hw/xen: Don't use '#' flag of printf format 2020-12-13 17:02:42 +01:00
xen_pt_graphics.c
xen_pt_load_rom.c pci: add romsize property 2021-02-05 08:52:58 -05:00
xen_pt_msi.c hw/xen: Don't use '#' flag of printf format 2020-12-13 17:02:42 +01:00
xen_pt_stub.c
xen_pt.c memory: Name all the memory listeners 2021-09-30 15:30:24 +02:00
xen_pt.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
xen_pvdev.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
xen-backend.c xen-bus: reduce scope of backend watch 2020-10-19 16:32:41 +01:00
xen-bus-helper.c hw: Do not include hw/sysbus.h if it is not necessary 2021-05-02 17:24:50 +02:00
xen-bus.c qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
xen-host-pci-device.c xen: Use ERRP_GUARD() 2020-07-10 15:18:09 +02:00
xen-host-pci-device.h
xen-legacy-backend.c softmmu/qdev-monitor: add error handling in qdev_set_id 2021-10-15 16:08:46 +02:00