From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QORvl-0000xd-NW for qemu-devel@nongnu.org; Mon, 23 May 2011 06:00:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QORvf-0001Zl-Rp for qemu-devel@nongnu.org; Mon, 23 May 2011 06:00:09 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:44741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QORvf-0001ZR-JZ for qemu-devel@nongnu.org; Mon, 23 May 2011 06:00:03 -0400 Received: by gyg4 with SMTP id 4so2373030gyg.4 for ; Mon, 23 May 2011 03:00:03 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4DDA0709.4080601@in.ibm.com> References: <20110519170730.29027.44430.sendpatchset@skannery> <20110519170803.29027.15255.sendpatchset@skannery> <20110520082033.GA6003@stefanha-thinkpad.localdomain> <4DDA0709.4080601@in.ibm.com> Date: Mon, 23 May 2011 11:00:02 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [V2 2/2]Qemu: Add commands "hostcache_set" and "hostcache_get" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Supriya Kannery Cc: Kevin Wolf , Supriya Kannery , Luiz Capitulino , qemu-devel@nongnu.org, Christoph Hellwig On Mon, May 23, 2011 at 8:04 AM, Supriya Kannery wrot= e: > On 05/20/2011 01:50 PM, Stefan Hajnoczi wrote: >> >> On Thu, May 19, 2011 at 10:38:03PM +0530, Supriya Kannery wrote: >>> >>> Monitor commands "hostcache_set" and "hostcache_get" added for dynamic >>> host cache change and display of host cache setting respectively. >> >> A generic command for changing block device options would be nice, >> althought I don't see other options where it makes sense to change them >> at runtime. >> >> The alternative would be: >> >> block_set hostcache on >> >> "block_set", {"device": "ide1-cd0", "name": "hostcache", "enable": true} >> >> The hostcache_get information would be part of query-block output: >> =A0 =A0 =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 =A0 =A0 "device":"ide0-hd0", >> =A0 =A0 =A0 =A0 =A0 =A0 "locked":false, >> =A0 =A0 =A0 =A0 =A0 =A0 "removable":false, >> =A0 =A0 =A0 =A0 =A0 =A0 "inserted":{ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"ro":false, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"drv":"qcow2", >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"encrypted":false, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"file":"disks/test.img" >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 "hostcache":true, >> =A0 =A0 =A0 =A0 =A0 =A0 }, >> =A0 =A0 =A0 =A0 =A0 =A0 "type":"hd" >> =A0 =A0 =A0 =A0 =A0}, >> >> This approach is extensible if more options need to be exposed. > > Sure, I will resubmit this patchset, after making this feature more gener= ic. > Can you pls help finding atleast one or two options (other than hostcache= ) > which can be changed dynamically. This will help me evaluate the generic > approach. Hang on, let's see if we can get agreement from Kevin and others before taking this approach. Like I said, I don't see other options that should be changed at runtime. > >>> + =A0 =A0 =A0 =A0.params =A0 =A0 =3D "device", >>> + =A0 =A0 =A0 =A0.help =A0 =A0 =A0 =3D "retrieve host cache settings fo= r device", >> >> Please make it clear these operations affect block devices: >> "for block device" > > ok > >> >>> + =A0 =A0/* >>> + =A0 =A0 * A failed attempt to reopen the image file must lead to 'abo= rt()' >>> + =A0 =A0 */ >>> + =A0 =A0if (ret !=3D 0) { >>> + =A0 =A0 =A0 =A0qerror_report(QERR_REOPEN_FILE_FAILED, bs->filename); >>> + =A0 =A0 =A0 =A0abort(); >> >> The error is never reported on a QMP monitor because qerror_report() >> simply stashes away the qerror. =A0The QMP client doesn't have a chance = to >> read the error before QEMU terminates. >> > > Verified this from qemu command line and the error got displayed before > aborting (when the image file was renamed while VM was running). QMP takes a different code path from the human monitor (HMP) that you used; see monitor_cur_is_qmp() and how it affects the qerror_report() path. CCing Luiz to see whether there is a strategy that we should use here to ensure the error message does get delivered to the QMP client before exiting. Stefan