summaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-02-18 17:25:24 +0100
committerMarkus Armbruster <armbru@redhat.com>2010-03-16 16:58:32 +0100
commit1ecda02b24a13f501e747b8442934829d82698ae (patch)
tree8989913831ca3e48220b57f9104978015e39c5cb /savevm.c
parent6fdb03d58c614e0097d80ed130c19dcc393f7421 (diff)
downloadqemu-1ecda02b24a13f501e747b8442934829d82698ae.zip
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/savevm.c b/savevm.c
index b634686e4f..bee1be18a5 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1747,7 +1747,7 @@ int load_vmstate(const char *name)
bs = get_bs_snapshots();
if (!bs) {
- qemu_error("No block device supports snapshots\n");
+ error_report("No block device supports snapshots");
return -EINVAL;
}
@@ -1759,20 +1759,21 @@ int load_vmstate(const char *name)
if (bdrv_has_snapshot(bs1)) {
ret = bdrv_snapshot_goto(bs1, name);
if (ret < 0) {
- if (bs != bs1)
- qemu_error("Warning: ");
switch(ret) {
case -ENOTSUP:
- qemu_error("Snapshots not supported on device '%s'\n",
- bdrv_get_device_name(bs1));
+ error_report("%sSnapshots not supported on device '%s'",
+ bs != bs1 ? "Warning: " : "",
+ bdrv_get_device_name(bs1));
break;
case -ENOENT:
- qemu_error("Could not find snapshot '%s' on device '%s'\n",
- name, bdrv_get_device_name(bs1));
+ error_report("%sCould not find snapshot '%s' on device '%s'",
+ bs != bs1 ? "Warning: " : "",
+ name, bdrv_get_device_name(bs1));
break;
default:
- qemu_error("Error %d while activating snapshot on '%s'\n",
- ret, bdrv_get_device_name(bs1));
+ error_report("%sError %d while activating snapshot on '%s'",
+ bs != bs1 ? "Warning: " : "",
+ ret, bdrv_get_device_name(bs1));
break;
}
/* fatal on snapshot block device */
@@ -1790,13 +1791,13 @@ int load_vmstate(const char *name)
/* restore the VM state */
f = qemu_fopen_bdrv(bs, 0);
if (!f) {
- qemu_error("Could not open VM state file\n");
+ error_report("Could not open VM state file");
return -EINVAL;
}
ret = qemu_loadvm_state(f);
qemu_fclose(f);
if (ret < 0) {
- qemu_error("Error %d while loading VM state\n", ret);
+ error_report("Error %d while loading VM state", ret);
return ret;
}
return 0;