summaryrefslogtreecommitdiff
path: root/hw/core/qdev-properties-system.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/core/qdev-properties-system.c')
-rw-r--r--hw/core/qdev-properties-system.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index a2e44bd4e8..c413226a97 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -341,27 +341,25 @@ PropertyInfo qdev_prop_vlan = {
.set = set_vlan,
};
-int qdev_prop_set_drive(DeviceState *dev, const char *name,
- BlockBackend *value)
+void qdev_prop_set_drive(DeviceState *dev, const char *name,
+ BlockBackend *value, Error **errp)
{
- Error *err = NULL;
- object_property_set_str(OBJECT(dev),
- value ? blk_name(value) : "", name, &err);
- if (err) {
- qerror_report_err(err);
- error_free(err);
- return -1;
- }
- return 0;
+ object_property_set_str(OBJECT(dev), value ? blk_name(value) : "",
+ name, errp);
}
void qdev_prop_set_drive_nofail(DeviceState *dev, const char *name,
BlockBackend *value)
{
- if (qdev_prop_set_drive(dev, name, value) < 0) {
+ Error *err = NULL;
+
+ qdev_prop_set_drive(dev, name, value, &err);
+ if (err) {
+ error_report_err(err);
exit(1);
}
}
+
void qdev_prop_set_chr(DeviceState *dev, const char *name,
CharDriverState *value)
{