summaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2010-03-17 09:44:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-17 09:44:37 -0500
commit4a39943bd1fd2ac7e3163f9d9b056394519661f3 (patch)
treeeab01e0258d2344117873952b589bac333bb0ea3 /savevm.c
parent7d834c7450245335db0a7055ccdc783ccab21935 (diff)
parent8bc27249f0f62524887ea355a6604722edd276a9 (diff)
downloadqemu-4a39943bd1fd2ac7e3163f9d9b056394519661f3.tar.gz
qemu-4a39943bd1fd2ac7e3163f9d9b056394519661f3.tar.bz2
qemu-4a39943bd1fd2ac7e3163f9d9b056394519661f3.zip
Merge remote branch 'markus/qerror' into staging
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/savevm.c b/savevm.c
index 15477e9d82..086c92a704 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1737,7 +1737,7 @@ void do_savevm(Monitor *mon, const QDict *qdict)
vm_start();
}
-int load_vmstate(Monitor *mon, const char *name)
+int load_vmstate(const char *name)
{
DriveInfo *dinfo;
BlockDriverState *bs, *bs1;
@@ -1747,7 +1747,7 @@ int load_vmstate(Monitor *mon, const char *name)
bs = get_bs_snapshots();
if (!bs) {
- monitor_printf(mon, "No block device supports snapshots\n");
+ error_report("No block device supports snapshots");
return -EINVAL;
}
@@ -1759,22 +1759,21 @@ int load_vmstate(Monitor *mon, const char *name)
if (bdrv_has_snapshot(bs1)) {
ret = bdrv_snapshot_goto(bs1, name);
if (ret < 0) {
- if (bs != bs1)
- monitor_printf(mon, "Warning: ");
switch(ret) {
case -ENOTSUP:
- monitor_printf(mon,
- "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:
- monitor_printf(mon, "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:
- monitor_printf(mon, "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 */
@@ -1792,13 +1791,13 @@ int load_vmstate(Monitor *mon, const char *name)
/* restore the VM state */
f = qemu_fopen_bdrv(bs, 0);
if (!f) {
- monitor_printf(mon, "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) {
- monitor_printf(mon, "Error %d while loading VM state\n", ret);
+ error_report("Error %d while loading VM state", ret);
return ret;
}
return 0;