Am 28.02.2011 16:35, schrieb Stefan Hajnoczi:
> On Mon, Feb 28, 2011 at 3:12 PM, Kevin Wolf <kw...@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 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?)

> 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

Reply via email to