提交 a7737e44 编写于 作者: M Markus Armbruster 提交者: Andreas Färber

hw: Consistently name Error ** objects errp, and not err

Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 2f719f19
...@@ -174,14 +174,14 @@ int qdev_init(DeviceState *dev) ...@@ -174,14 +174,14 @@ int qdev_init(DeviceState *dev)
return 0; return 0;
} }
static void device_realize(DeviceState *dev, Error **err) static void device_realize(DeviceState *dev, Error **errp)
{ {
DeviceClass *dc = DEVICE_GET_CLASS(dev); DeviceClass *dc = DEVICE_GET_CLASS(dev);
if (dc->init) { if (dc->init) {
int rc = dc->init(dev); int rc = dc->init(dev);
if (rc < 0) { if (rc < 0) {
error_setg(err, "Device initialization failed."); error_setg(errp, "Device initialization failed.");
return; return;
} }
} }
...@@ -504,14 +504,14 @@ static void bus_unparent(Object *obj) ...@@ -504,14 +504,14 @@ static void bus_unparent(Object *obj)
} }
} }
static bool bus_get_realized(Object *obj, Error **err) static bool bus_get_realized(Object *obj, Error **errp)
{ {
BusState *bus = BUS(obj); BusState *bus = BUS(obj);
return bus->realized; return bus->realized;
} }
static void bus_set_realized(Object *obj, bool value, Error **err) static void bus_set_realized(Object *obj, bool value, Error **errp)
{ {
BusState *bus = BUS(obj); BusState *bus = BUS(obj);
BusClass *bc = BUS_GET_CLASS(bus); BusClass *bc = BUS_GET_CLASS(bus);
...@@ -540,7 +540,7 @@ static void bus_set_realized(Object *obj, bool value, Error **err) ...@@ -540,7 +540,7 @@ static void bus_set_realized(Object *obj, bool value, Error **err)
return; return;
error: error:
error_propagate(err, local_err); error_propagate(errp, local_err);
} }
void qbus_create_inplace(void *bus, size_t size, const char *typename, void qbus_create_inplace(void *bus, size_t size, const char *typename,
...@@ -724,13 +724,13 @@ void qdev_property_add_static(DeviceState *dev, Property *prop, ...@@ -724,13 +724,13 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,
} }
} }
static bool device_get_realized(Object *obj, Error **err) static bool device_get_realized(Object *obj, Error **errp)
{ {
DeviceState *dev = DEVICE(obj); DeviceState *dev = DEVICE(obj);
return dev->realized; return dev->realized;
} }
static void device_set_realized(Object *obj, bool value, Error **err) static void device_set_realized(Object *obj, bool value, Error **errp)
{ {
DeviceState *dev = DEVICE(obj); DeviceState *dev = DEVICE(obj);
DeviceClass *dc = DEVICE_GET_CLASS(dev); DeviceClass *dc = DEVICE_GET_CLASS(dev);
...@@ -738,7 +738,7 @@ static void device_set_realized(Object *obj, bool value, Error **err) ...@@ -738,7 +738,7 @@ static void device_set_realized(Object *obj, bool value, Error **err)
Error *local_err = NULL; Error *local_err = NULL;
if (dev->hotplugged && !dc->hotpluggable) { if (dev->hotplugged && !dc->hotpluggable) {
error_set(err, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj)); error_set(errp, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj));
return; return;
} }
...@@ -797,14 +797,14 @@ static void device_set_realized(Object *obj, bool value, Error **err) ...@@ -797,14 +797,14 @@ static void device_set_realized(Object *obj, bool value, Error **err)
} }
if (local_err != NULL) { if (local_err != NULL) {
error_propagate(err, local_err); error_propagate(errp, local_err);
return; return;
} }
dev->realized = value; dev->realized = value;
} }
static bool device_get_hotpluggable(Object *obj, Error **err) static bool device_get_hotpluggable(Object *obj, Error **errp)
{ {
DeviceClass *dc = DEVICE_GET_CLASS(obj); DeviceClass *dc = DEVICE_GET_CLASS(obj);
DeviceState *dev = DEVICE(obj); DeviceState *dev = DEVICE(obj);
......
...@@ -412,7 +412,7 @@ static const MemoryRegionOps pic_elcr_ioport_ops = { ...@@ -412,7 +412,7 @@ static const MemoryRegionOps pic_elcr_ioport_ops = {
}, },
}; };
static void pic_realize(DeviceState *dev, Error **err) static void pic_realize(DeviceState *dev, Error **errp)
{ {
PICCommonState *s = PIC_COMMON(dev); PICCommonState *s = PIC_COMMON(dev);
PICClass *pc = PIC_GET_CLASS(dev); PICClass *pc = PIC_GET_CLASS(dev);
...@@ -425,7 +425,7 @@ static void pic_realize(DeviceState *dev, Error **err) ...@@ -425,7 +425,7 @@ static void pic_realize(DeviceState *dev, Error **err)
qdev_init_gpio_out(dev, s->int_out, ARRAY_SIZE(s->int_out)); qdev_init_gpio_out(dev, s->int_out, ARRAY_SIZE(s->int_out));
qdev_init_gpio_in(dev, pic_set_irq, 8); qdev_init_gpio_in(dev, pic_set_irq, 8);
pc->parent_realize(dev, err); pc->parent_realize(dev, errp);
} }
void pic_info(Monitor *mon, const QDict *qdict) void pic_info(Monitor *mon, const QDict *qdict)
......
...@@ -322,7 +322,7 @@ static void pit_post_load(PITCommonState *s) ...@@ -322,7 +322,7 @@ static void pit_post_load(PITCommonState *s)
} }
} }
static void pit_realizefn(DeviceState *dev, Error **err) static void pit_realizefn(DeviceState *dev, Error **errp)
{ {
PITCommonState *pit = PIT_COMMON(dev); PITCommonState *pit = PIT_COMMON(dev);
PITClass *pc = PIT_GET_CLASS(dev); PITClass *pc = PIT_GET_CLASS(dev);
...@@ -338,7 +338,7 @@ static void pit_realizefn(DeviceState *dev, Error **err) ...@@ -338,7 +338,7 @@ static void pit_realizefn(DeviceState *dev, Error **err)
qdev_init_gpio_in(dev, pit_irq_control, 1); qdev_init_gpio_in(dev, pit_irq_control, 1);
pc->parent_realize(dev, err); pc->parent_realize(dev, errp);
} }
static Property pit_properties[] = { static Property pit_properties[] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册