qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Supriya Kannery <supriyak@in.ibm.com>,
	qemu-devel@nongnu.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [Qemu-devel] [V4 Patch 3/4 - Updated]Qemu: Command "block_set" for dynamic block params change
Date: Mon, 25 Jul 2011 15:34:16 +0200	[thread overview]
Message-ID: <4E2D70D8.8060505@redhat.com> (raw)
In-Reply-To: <CAJSP0QVLzDVqTfXTFYVgLSFYZn_PBYb0uToM351UGr759v57hA@mail.gmail.com>

Am 25.07.2011 14:50, schrieb Stefan Hajnoczi:
> On Mon, Jul 25, 2011 at 1:52 PM, Supriya Kannery <supriyak@in.ibm.com> wrote:
>> On 07/25/2011 12:00 PM, Stefan Hajnoczi wrote:
>>>
>>> On Wed, Jul 13, 2011 at 06:37:05PM +0530, Supriya Kannery wrote:
>>>> +    if (bdrv_is_inserted(bs)) {
>>>> +        /* Reopen file with changed set of flags */
>>>> +        return bdrv_reopen(bs, bdrv_flags);
>>>> +    } else {
>>>> +        /* Save hostcache change for future use */
>>>> +        bs->open_flags = bdrv_flags;
>>
>>>
>>> Can you explain the scenario where this works?
>>>
>>> Looking at do_change_block() the flags will be clobbered so saving them
>>> away does not help.
>>
>> Intention here is to use the changed hostcache setting during device
>> insertion and there after. To apply this to 'change' command (during
>> insertion of a device), will need to make the following code changes
>> in do_change_block.
>>
>> +
>> +    bdrv_flags = bs->open_flags;
>> +    bdrv_flags |= bdrv_is_read_only(bs) ? 0 : BDRV_O_RDWR;
>>     bdrv_flags |= bdrv_is_snapshot(bs) ? BDRV_O_SNAPSHOT : 0;
>>     if (bdrv_open(bs, filename, bdrv_flags, drv) < 0) {
>>         qerror_report(QERR_OPEN_FILE_FAILED, filename);
>>
>> Need to track bs->open_flags a bit more to see what other changes
>> needed to ensure usage of changed hostcache setting until user
>> initiates next hostcache change explicitly for that drive.
>>
>> Please suggest... should we be saving the hostcache change for
>> future use or just inhibit user from changing hostcache setting
>> for an empty drive?
> 
> The 'change' command does not support any cache= options today.  It
> always opens the new image with cache=writethrough semantics.
> 
> This seems like a bug in 'change' to me.  We should preserve cache=
> settings across change or at least provide a way to specify them as
> arguments.
> 
> Perhaps your existing code is fine.  When 'change' is fixed or
> replaced then 'block_set' will work across 'change' too.
> 
> Kevin: Thoughts?

I'm not sure if I would say it's a bug. Probably preserving would be
more useful in most cases, but using the default cache mode doesn't
appear completely wrong either. If you like to change it, I'm not
opposed to it.

Kevin

  reply	other threads:[~2011-07-25 13:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04 10:42 [Qemu-devel] [V4 Patch 0/4]Qemu: Hostcache setting from cmdline and monitor Supriya Kannery
2011-07-04 10:42 ` [Qemu-devel] [V4 Patch 1/4]Qemu: Enhance "info block" to display host cache setting Supriya Kannery
2011-07-04 11:54   ` Stefan Hajnoczi
2011-07-05 10:49     ` [Qemu-devel] [V4 Patch 1/4 -Updated]Qemu: " Supriya Kannery
2011-07-20  7:37       ` Supriya Kannery
2011-07-04 10:43 ` [Qemu-devel] [V4 Patch 2/4]Qemu: Error classes for file reopen and data sync failure Supriya Kannery
2011-07-04 10:43 ` [Qemu-devel] [V4 Patch 3/4]Qemu: Command "block_set" for dynamic block params change Supriya Kannery
2011-07-04 12:29   ` Stefan Hajnoczi
2011-07-05 10:55     ` Supriya Kannery
2011-07-13 13:07       ` [Qemu-devel] [V4 Patch 3/4 - Updated]Qemu: " Supriya Kannery
2011-07-20  7:38         ` Supriya Kannery
2011-07-25  6:30         ` Stefan Hajnoczi
2011-07-25 12:52           ` Supriya Kannery
2011-07-25 12:50             ` Stefan Hajnoczi
2011-07-25 13:34               ` Kevin Wolf [this message]
2011-07-26  5:47                 ` Supriya Kannery
2011-07-04 12:35   ` [Qemu-devel] [V4 Patch 3/4]Qemu: " Stefan Hajnoczi
2011-07-04 10:43 ` [Qemu-devel] [V4 Patch 4/4]Qemu: Add commandline -drive option 'hostcache' Supriya Kannery
2011-07-04 12:31   ` Stefan Hajnoczi
2011-07-05 11:05     ` [Qemu-devel] [V4 Patch 4/4 - Updated]Qemu: " Supriya Kannery
2011-07-20  7:39       ` Supriya Kannery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E2D70D8.8060505@redhat.com \
    --to=kwolf@redhat.com \
    --cc=hch@lst.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=supriyak@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).