error: Use error_report_err() where appropriate (again)
Same Coccinelle semantic patch as in commit565f65d
. We now use the original error whole instead of just its message obtained with error_get_pretty(). This avoids suppressing its hint (see commit50b7b00
), but I don't think the errors touched in this commit can come with hints. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-3-git-send-email-armbru@redhat.com>
This commit is contained in:
parent
85b01e0960
commit
4fffeb5e19
@ -1861,8 +1861,7 @@ static int sd_create(const char *filename, QemuOpts *opts,
|
|||||||
|
|
||||||
fd = connect_to_sdog(s, &local_err);
|
fd = connect_to_sdog(s, &local_err);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
error_report("%s", error_get_pretty(local_err));
|
error_report_err(local_err);
|
||||||
error_free(local_err);
|
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ static void imx25_pdk_init(MachineState *machine)
|
|||||||
|
|
||||||
object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
|
object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
error_report("%s", error_get_pretty(err));
|
error_report_err(err);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ static void kzm_init(MachineState *machine)
|
|||||||
|
|
||||||
object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
|
object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
error_report("%s", error_get_pretty(err));
|
error_report_err(err);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ static void netduino2_init(MachineState *machine)
|
|||||||
qdev_prop_set_string(dev, "cpu-model", "cortex-m3");
|
qdev_prop_set_string(dev, "cpu-model", "cortex-m3");
|
||||||
object_property_set_bool(OBJECT(dev), true, "realized", &err);
|
object_property_set_bool(OBJECT(dev), true, "realized", &err);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
error_report("%s", error_get_pretty(err));
|
error_report_err(err);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ static void xlnx_ep108_init(MachineState *machine)
|
|||||||
|
|
||||||
object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
|
object_property_set_bool(OBJECT(&s->soc), true, "realized", &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
error_report("%s", error_get_pretty(err));
|
error_report_err(err);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,8 +465,7 @@ static void realize(DeviceState *d, Error **errp)
|
|||||||
object_property_add_alias(root_container, link_name,
|
object_property_add_alias(root_container, link_name,
|
||||||
drc->owner, child_name, &err);
|
drc->owner, child_name, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
error_report("%s", error_get_pretty(err));
|
error_report_err(err);
|
||||||
error_free(err);
|
|
||||||
object_unref(OBJECT(drc));
|
object_unref(OBJECT(drc));
|
||||||
}
|
}
|
||||||
g_free(child_name);
|
g_free(child_name);
|
||||||
@ -486,8 +485,7 @@ static void unrealize(DeviceState *d, Error **errp)
|
|||||||
snprintf(name, sizeof(name), "%x", drck->get_index(drc));
|
snprintf(name, sizeof(name), "%x", drck->get_index(drc));
|
||||||
object_property_del(root_container, name, &err);
|
object_property_del(root_container, name, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
error_report("%s", error_get_pretty(err));
|
error_report_err(err);
|
||||||
error_free(err);
|
|
||||||
object_unref(OBJECT(drc));
|
object_unref(OBJECT(drc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ int main(int argc, char **argv)
|
|||||||
exp = nbd_export_new(blk, dev_offset, fd_size, nbdflags, nbd_export_closed,
|
exp = nbd_export_new(blk, dev_offset, fd_size, nbdflags, nbd_export_closed,
|
||||||
&local_err);
|
&local_err);
|
||||||
if (!exp) {
|
if (!exp) {
|
||||||
error_report("%s", error_get_pretty(local_err));
|
error_report_err(local_err);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
vl.c
2
vl.c
@ -4553,7 +4553,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
Error *local_err = NULL;
|
Error *local_err = NULL;
|
||||||
qemu_boot_set(boot_once, &local_err);
|
qemu_boot_set(boot_once, &local_err);
|
||||||
if (local_err) {
|
if (local_err) {
|
||||||
error_report("%s", error_get_pretty(local_err));
|
error_report_err(local_err);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
qemu_register_reset(restore_boot_order, g_strdup(boot_order));
|
qemu_register_reset(restore_boot_order, g_strdup(boot_order));
|
||||||
|
Loading…
Reference in New Issue
Block a user