aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/mst_fpga.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-09-16 13:17:07 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-13 10:47:50 +0200
commit69520261204b9a1769134ed24b92cc0fa8445951 (patch)
tree296411dfa078cb921832c746b6cebecdac0668c0 /hw/misc/mst_fpga.c
parentb71803a74612cc73eee82681f942a083038642ba (diff)
downloadqemu-69520261204b9a1769134ed24b92cc0fa8445951.zip
qemu-69520261204b9a1769134ed24b92cc0fa8445951.tar.gz
qemu-69520261204b9a1769134ed24b92cc0fa8445951.tar.bz2
monitor: Tidy up find_device_state()
Commit 6287d827d4 "monitor: allow device_del to accept QOM paths" extended find_device_state() to accept QOM paths in addition to qdev IDs. This added a checked conversion to TYPE_DEVICE at the end, which duplicates the check done for the qdev ID case earlier, except it sets a *different* error: GenericError "ID is not a hotpluggable device" when passed a QOM path, and DeviceNotFound "Device 'ID' not found" when passed a qdev ID. Fortunately, the latter won't happen as long as we add only devices to /machine/peripheral/. Earlier, commit b6cc36abb2 "qdev: device_del: Search for to be unplugged device in 'peripheral' container" rewrote the lookup by qdev ID to use QOM instead of qdev_find_recursive(), so it can handle buss-less devices. It does so by constructing an absolute QOM path. Works, but object_resolve_path_component() is easier. Switching to it also gets rid of the unclean duplication described above. While there, avoid converting to TYPE_DEVICE twice, first to check whether it's possible, and then for real. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20210916111707.84999-1-armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/misc/mst_fpga.c')
0 files changed, 0 insertions, 0 deletions