monitor: Make "commit FOO" complain when FOO doesn't exist
authorMarkus Armbruster <armbru@redhat.com>
Wed, 2 Jun 2010 16:55:19 +0000 (18:55 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 15 Jun 2010 07:41:59 +0000 (09:41 +0200)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c

index d74cd1d80233c9b141a25cadde8472f69fa4ca09..f636bc691642de442e840f7b6c025337ef421e8d 100644 (file)
@@ -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);
     }
 }