@@ -1682,7 +1682,7 @@ void do_savevm(Monitor *mon, const QDict *qdict)
bs = get_bs_snapshots();
if (!bs) {
- monitor_printf(mon, "No block device can accept snapshots\n");
+ qerror_report(QERR_SNAPSHOT_NO_DEVICE);
return;
}
@@ -1726,7 +1726,7 @@ void do_savevm(Monitor *mon, const QDict *qdict)
vm_state_size = qemu_ftell(f);
qemu_fclose(f);
if (ret < 0) {
- monitor_printf(mon, "Error %d while writing VM\n", ret);
+ qerror_report(QERR_STATEVM_SAVE_FAILED, get_errno_string(ret));
goto the_end;
}
@@ -1739,8 +1739,8 @@ void do_savevm(Monitor *mon, const QDict *qdict)
sn->vm_state_size = (bs == bs1 ? vm_state_size : 0);
ret = bdrv_snapshot_create(bs1, sn);
if (ret < 0) {
- monitor_printf(mon, "Error while creating snapshot on '%s'\n",
- bdrv_get_device_name(bs1));
+ qerror_report(QERR_SNAPSHOT_CREATE_FAILED,
+ bdrv_get_device_name(bs1), get_errno_string(ret));
}
}
}
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> --- savevm.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)