qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [V4 Patch 3/4 - Updated]Qemu: Command "block_set" for d


From: Supriya Kannery
Subject: Re: [Qemu-devel] [V4 Patch 3/4 - Updated]Qemu: Command "block_set" for dynamic block params change
Date: Tue, 26 Jul 2011 11:17:07 +0530
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2

On 07/25/2011 07:04 PM, Kevin Wolf wrote:
Am 25.07.2011 14:50, schrieb Stefan Hajnoczi:
On Mon, Jul 25, 2011 at 1:52 PM, Supriya Kannery<address@hidden>  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


ok, so for now, will retain the code that saves hostcache setting
for empty drives. When other commands (like 'change') are focused,
can look at using this saved setting.

Will post V5 with other error_report related code changes.

thanks, Supriya



reply via email to

[Prev in Thread] Current Thread [Next in Thread]