]> git.proxmox.com Git - mirror_qemu.git/commit - hw/usb/dev-smartcard-reader.c
qdev: Drop qbus_set_hotplug_handler() parameter @errp
authorMarkus Armbruster <armbru@redhat.com>
Tue, 30 Jun 2020 09:03:39 +0000 (11:03 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 2 Jul 2020 04:25:29 +0000 (06:25 +0200)
commit9bc6bfdf67287fcf5435f22f68e902bb19831243
tree4b849f7afb2a1ed5738a239124f685f92e0bb732
parentcd7c866074ed413bb0ccb708f7660436beb4ce37
qdev: Drop qbus_set_hotplug_handler() parameter @errp

qbus_set_hotplug_handler() is a simple wrapper around
object_property_set_link().

object_property_set_link() fails when the property doesn't exist, is
not settable, or its .check() method fails.  These are all programming
errors here, so passing &error_abort to qbus_set_hotplug_handler() is
appropriate.

Most of its callers do.  Exceptions:

* pcie_cap_slot_init(), shpc_init(), spapr_phb_realize() pass NULL,
  i.e. they ignore errors.

* spapr_machine_init() passes &error_fatal.

* s390_pcihost_realize(), virtio_serial_device_realize(),
  s390_pcihost_plug() pass the error to their callers.  The latter two
  keep going after the error, which looks wrong.

Drop the @errp parameter, and instead pass &error_abort to
object_property_set_link().

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200630090351.1247703-15-armbru@redhat.com>
15 files changed:
hw/acpi/pcihp.c
hw/acpi/piix4.c
hw/char/virtio-serial-bus.c
hw/core/bus.c
hw/pci/pcie.c
hw/pci/shpc.c
hw/ppc/spapr.c
hw/ppc/spapr_pci.c
hw/s390x/ap-bridge.c
hw/s390x/css-bridge.c
hw/s390x/s390-pci-bus.c
hw/scsi/virtio-scsi.c
hw/scsi/vmw_pvscsi.c
hw/usb/dev-smartcard-reader.c
include/hw/qdev-core.h