From patchwork Tue Jun 15 14:19:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [13/19] monitor: Make "commit FOO" complain when FOO doesn't exist Date: Tue, 15 Jun 2010 04:19:35 -0000 From: Kevin Wolf X-Patchwork-Id: 55696 Message-Id: <1276611581-3757-14-git-send-email-kwolf@redhat.com> To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- blockdev.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index d74cd1d..f636bc6 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); } }