From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWwem-0006wY-61 for qemu-devel@nongnu.org; Fri, 31 Jul 2009 14:16:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWweh-0006s1-IT for qemu-devel@nongnu.org; Fri, 31 Jul 2009 14:16:39 -0400 Received: from [199.232.76.173] (port=44726 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWweh-0006ru-ES for qemu-devel@nongnu.org; Fri, 31 Jul 2009 14:16:35 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53501) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWweh-0005gb-34 for qemu-devel@nongnu.org; Fri, 31 Jul 2009 14:16:35 -0400 Date: Fri, 31 Jul 2009 15:15:41 -0300 From: Luiz Capitulino Message-ID: <20090731151541.701b8c60@doriath> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Fix do_commit() behavior List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, kraxel@redhat.com Commit 751c6a17042b5d011013d6963c0505d671cf708e changed the monitor's 'commit' command to this behavior: 1. Any string you type as argument will cause do_commit() to call bdrv_commit() to all devices 2. If you enter a device name, it will be the only one ignored by do_commit() :) The fix is to call bdrv_commit() to the specified device only and ignore the others (when 'all' is not specified). Signed-off-by: Luiz Capitulino --- monitor.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/monitor.c b/monitor.c index 9093254..32fc26a 100644 --- a/monitor.c +++ b/monitor.c @@ -259,7 +259,7 @@ static void do_commit(Monitor *mon, const char *device) all_devices = !strcmp(device, "all"); TAILQ_FOREACH(dinfo, &drives, next) { if (!all_devices) - if (!strcmp(bdrv_get_device_name(dinfo->bdrv), device)) + if (strcmp(bdrv_get_device_name(dinfo->bdrv), device)) continue; bdrv_commit(dinfo->bdrv); } -- 1.6.4.rc3.12.gdf73a