Patchwork [16/22] savevm: Convert delete_snapshot() to QError

login
register
mail settings
Submitter Luiz Capitulino
Date April 20, 2010, 9:09 p.m.
Message ID <1271797792-24571-17-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/50597/
State New
Headers show

Comments

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

Patch

diff --git a/savevm.c b/savevm.c
index 3ccb246..55cf848 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1628,12 +1628,11 @@  static int delete_snapshot(Monitor *mon, BlockDriverState *bs,
     if (ret < 0) {
         switch (ret) {
         case -ENOTSUP:
-            monitor_printf(mon, "Snapshots not supported on device '%s'\n",
-                           bdrv_get_device_name(bs));
+            qerror_report(QERR_DEVICE_NO_SNAPSHOT, bdrv_get_device_name(bs));
             break;
         default:
-            monitor_printf(mon, "Error %d while deleting snapshot on '%s'\n",
-                           ret, bdrv_get_device_name(bs));
+            qerror_report(QERR_SNAPSHOT_DELETE_FAILED, bdrv_get_device_name(bs),
+                          get_errno_string(ret));
             break;
         }
     }