diff mbox

[03/13] monitor: Make "commit FOO" complain when FOO doesn't exist

Message ID 1275497729-13120-4-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster June 2, 2010, 4:55 p.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 blockdev.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/blockdev.c b/blockdev.c
index 60c9211..53a0e9c 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -493,9 +493,11 @@  void do_commit(Monitor *mon, const QDict *qdict)
         bdrv_commit_all();
     } else {
         bs = bdrv_find(device);
-        if (bs) {
-            bdrv_commit(bs);
+        if (!bs) {
+            qerror_report(QERR_DEVICE_NOT_FOUND, device);
+            return;
         }
+        bdrv_commit(bs);
     }
 }