Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nuq6b-0005iM-I8 for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:40:25 -0400 Received: from [140.186.70.92] (port=54309 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nuq6Z-0005hH-QS for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:40:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nuq6Y-0004OY-Cn for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:40:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6418) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nuq6Y-0004OU-5k for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:40:22 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH] Add qerror message if the 'change' target filename can't be opened References: <20100325143258.GS27260@us.ibm.com> Date: Thu, 25 Mar 2010 17:40:18 +0100 In-Reply-To: <20100325143258.GS27260@us.ibm.com> (Ryan Harper's message of "Thu, 25 Mar 2010 09:32:58 -0500") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ryan Harper Cc: qemu-devel@nongnu.org Ryan Harper writes: > Currently when using the change command to switch the file in the cd drive > the command doesn't complain if the file doesn't exit or can't be opened > and the drive keeps the existing image. This patch adds a qerror_report > call to print a message out indicating the failure. This error message > can be used to catch failures. > [...] > > Signed-off-by: Ryan Harper > --- > monitor.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/monitor.c b/monitor.c > index 0448a70..196c7a6 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -1099,6 +1099,7 @@ static int do_change_block(Monitor *mon, const char *device, > return -1; > } > if (bdrv_open2(bs, filename, BDRV_O_RDWR, drv) < 0) { > + qerror_report(QERR_OPEN_FILE_FAILED, filename); > return -1; > } > return monitor_read_bdrv_key_start(mon, bs, NULL, NULL); > -- We want this fix for QMP. Without it, we get UndefinedError, and a complaint ifdef CONFIG_DEBUG_MONITOR.