diff mbox

[19/22] savevm: Convert do_savevm() to QError

Message ID 1271797792-24571-20-git-send-email-lcapitulino@redhat.com
State New
Headers show

Commit Message

Luiz Capitulino April 20, 2010, 9:09 p.m. UTC
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 savevm.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/savevm.c b/savevm.c
index 031eeff..8a9e9d1 100644
--- a/savevm.c
+++ b/savevm.c
@@ -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));
             }
         }
     }