diff options
author | Markus Armbruster | 2020-06-22 11:42:24 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-06-23 16:07:07 +0200 |
commit | 934df912966683b942840f67b9d1a07c8cfea102 (patch) | |
tree | 17f3e4de0095b30a947992d1b7614981c1aff186 /hw/scsi/scsi-bus.c | |
parent | qdev: Reject chardev property override (diff) | |
download | qemu-934df912966683b942840f67b9d1a07c8cfea102.tar.gz qemu-934df912966683b942840f67b9d1a07c8cfea102.tar.xz qemu-934df912966683b942840f67b9d1a07c8cfea102.zip |
qdev: Make qdev_prop_set_drive() match the other helpers
qdev_prop_set_drive() can fail. None of the other qdev_prop_set_FOO()
can; they abort on error.
To clean up this inconsistency, rename qdev_prop_set_drive() to
qdev_prop_set_drive_err(), and create a qdev_prop_set_drive() that
aborts on error.
Coccinelle script to update callers:
@ depends on !(file in "hw/core/qdev-properties-system.c")@
expression dev, name, value;
symbol error_abort;
@@
- qdev_prop_set_drive(dev, name, value, &error_abort);
+ qdev_prop_set_drive(dev, name, value);
@@
expression dev, name, value, errp;
@@
- qdev_prop_set_drive(dev, name, value, errp);
+ qdev_prop_set_drive_err(dev, name, value, errp);
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200622094227.1271650-14-armbru@redhat.com>
Diffstat (limited to 'hw/scsi/scsi-bus.c')
-rw-r--r-- | hw/scsi/scsi-bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 1a7320c0af..27843bb04b 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -277,7 +277,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, if (serial && object_property_find(OBJECT(dev), "serial", NULL)) { qdev_prop_set_string(dev, "serial", serial); } - qdev_prop_set_drive(dev, "drive", blk, &err); + qdev_prop_set_drive_err(dev, "drive", blk, &err); if (err) { error_propagate(errp, err); object_unparent(OBJECT(dev)); |