From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41514 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuPEg-0005rU-Ho for qemu-devel@nongnu.org; Tue, 01 Mar 2011 08:03:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuPEV-0007EE-RV for qemu-devel@nongnu.org; Tue, 01 Mar 2011 08:03:26 -0500 Received: from mail-yw0-f45.google.com ([209.85.213.45]:58340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuPEV-0007Dd-Gq for qemu-devel@nongnu.org; Tue, 01 Mar 2011 08:03:19 -0500 Received: by ywl41 with SMTP id 41so2046829ywl.4 for ; Tue, 01 Mar 2011 05:03:18 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4D6BC3DE.7000208@redhat.com> References: <20110228171956.05a84fb9@zephyr> <4D6BBB72.6040205@redhat.com> <4D6BC3DE.7000208@redhat.com> Date: Tue, 1 Mar 2011 07:03:18 -0600 Message-ID: Subject: Re: [Qemu-devel] [RFC][PATCH 0/2] Allow cache settings for block devices to be changed at runtime. From: Anthony Liguori Content-Type: multipart/alternative; boundary=0023547c8d879439b4049d6b6bce List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Anthony Liguori , Stefan Hajnoczi , Stefan Hajnoczi , qemu-devel , Ananth Narayan , Prerna Saxena , Christoph Hellwig --0023547c8d879439b4049d6b6bce Content-Type: text/plain; charset=ISO-8859-1 On Feb 28, 2011 10:48 AM, "Kevin Wolf" wrote: > > Am 28.02.2011 16:35, schrieb Stefan Hajnoczi: > > On Mon, Feb 28, 2011 at 3:12 PM, Kevin Wolf wrote: > >> Am 28.02.2011 12:49, schrieb Prerna Saxena: > >>> The following patchset introduces monitor commands: > >>> > >>> 1. set_cache DEVICE CACHE-SETTING > >>> Change cache settings for block device, DEVICE, through the monitor. > >>> (Available options : 'none', 'writeback', 'writethrough') > >>> Eg, > >>> (qemu)set_cache ide0-hd0 none > >>> -> Changes cache setting for ide0-hd0 to 'none' > >> > >> Not sure if adding this interface is a good idea. I see that you only > >> add it for HMP, and we may consider that, but it's definitely not > >> suitable for QMP. > >> > >> One reason is that none/writethrough/writeback/unsafe isn't really what > >> we want to use long term. We want to separate advertising a write cache > >> (which is guest visible) from things like whether to use O_DIRECT or not. > >> > >> In the past, Christoph mentioned that he had patches to make these > >> separate and even let the guest change the "write cache enabled" flag, > >> which would probably solve most of the use cases of this patch. > > > > Toggling host page cache at runtime is useful too because it saves > > having to restart VMs. > > Not sure why I wanted to change that during runtime, but agreed, > allowing to change parameters using the monitor is generally a good thing. > > However, I'm not sure if a command for changing the cache mode is the > right solution, or if it should be something like a command to change > block device options. (For example, what about toggling read-only or > snapshot mode?) Certainly good questions, but let me suggest not taking an HMP command and not a QMP commans because of interface concerns. My goal for 0.15 is to convert HMP to be implemented in terms of QMP. To do that, a bunch of new QMP commands are needed. They all won't be perfect but i'd rather support a bad QMP command forever than to continue to/ have people rely on HMP. Regards, Anthony Liguori > > I agree that the guest should control the > > emulated drive cache at runtime and we probably don't want to allow > > toggling that from the host - it could be dangerous :). > > Good point. That's a NACK for this patch as long as we haven't separated > WCE from the host cache setting. > > Kevin > --0023547c8d879439b4049d6b6bce Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Feb 28, 2011 10:48 AM, "Kevin Wolf" <kwolf@redhat.com> wrote:
>
> Am 28.02.2011 16:35, schrieb Stefan Hajnoczi:
> > On Mon, Feb 28, 2011 at 3:12 PM, Kevin Wolf <kwolf@redhat.com> wrote:
> >> Am 28.02.2011 12:49, schrieb Prerna Saxena:
> >>> The following patchset introduces monitor commands:
> >>>
> >>> 1. set_cache DEVICE CACHE-SETTING
> >>> Change cache settings for block device, DEVICE, through t= he monitor.
> >>> (Available options : 'none', 'writeback',= 'writethrough')
> >>> Eg,
> >>> (qemu)set_cache ide0-hd0 none
> >>> -> Changes cache setting for ide0-hd0 to 'none'= ;
> >>
> >> Not sure if adding this interface is a good idea. I see that = you only
> >> add it for HMP, and we may consider that, but it's defini= tely not
> >> suitable for QMP.
> >>
> >> One reason is that none/writethrough/writeback/unsafe isn'= ;t really what
> >> we want to use long term. We want to separate advertising a w= rite cache
> >> (which is guest visible) from things like whether to use O_DI= RECT or not.
> >>
> >> In the past, Christoph mentioned that he had patches to make = these
> >> separate and even let the guest change the "write cache = enabled" flag,
> >> which would probably solve most of the use cases of this patc= h.
> >
> > Toggling host page cache at runtime is useful too because it save= s
> > having to restart VMs.
>
> Not sure why I wanted to change that during runtime, but agreed,
> allowing to change parameters using the monitor is generally a good th= ing.
>
> However, I'm not sure if a command for changing the cache mode is = the
> right solution, or if it should be something like a command to change<= br> > block device options. (For example, what about toggling read-only or > snapshot mode?)

Certainly good questions, but let me suggest not taking an HMP command a= nd not a QMP commans because of interface concerns.

My goal for 0.15 is to convert HMP to be implemented in terms of QMP.=A0= To do that, a bunch of new QMP commands are needed.=A0 They all won't = be perfect but i'd rather support a bad QMP command forever than to con= tinue to/ have people rely on HMP.

Regards,

Anthony Liguori

> > I agree that the guest should control the
> > emulated drive cache at runtime and we probably don't want to= allow
> > toggling that from the host - it could be dangerous :).
>
> Good point. That's a NACK for this patch as long as we haven't= separated
> WCE from the host cache setting.
>
> Kevin
>

--0023547c8d879439b4049d6b6bce--