qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] block: Fix open flags with BDRV_O_SNAPSHOT


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH] block: Fix open flags with BDRV_O_SNAPSHOT
Date: Tue, 06 May 2014 23:03:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 06.05.2014 13:10, Jan Kiszka wrote:
On 2014-05-06 12:19, Kevin Wolf wrote:
The immediately visible effect of this patch is that it fixes committing
a temporary snapshot to its backing file. Previously, it would fail with
a "permission denied" error because bdrv_inherited_flags() forced the
backing file to be read-only, ignoring the r/w reopen of bdrv_commit().

The bigger problem this releaved is that the original open flags must
actually only be applied to the temporary snapshot, and the original
image file must be treated as a backing file of the temporary snapshot
and get the right flags for that.

Reported-by: Jan Kiszka <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
  block.c                    | 34 +++++++++++++++++++---------------
  include/block/block.h      |  2 +-
  tests/qemu-iotests/051     |  4 ++++
  tests/qemu-iotests/051.out | 10 ++++++++++
  4 files changed, 34 insertions(+), 16 deletions(-)

[snip]

diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 01b0384..31e329e 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -358,4 +358,14 @@ wrote 4096/4096 bytes at offset 0
read 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) 
qqeqemqemuqemu-qemu-iqemu-ioqemu-io
 qemu-io iqemu-io 
idqemu-io ideqemu-io 
ide0qemu-io 
ide0-qemu-io 
ide0-hqemu-io 
ide0-hdqemu-io 
ide0-hd0qemu-io ide0-hd0 
qemu-io ide0-hd0 
"qemu-io ide0-hd0 
"wqemu-io ide0-hd0 
"wrqemu-io ide0-hd0 
"wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 
"writeqemu-io ide0-hd0 "write 
qemu-io ide0-hd0 "write 
-qemu-io ide0-hd0 "write 
-Pqemu-io ide0-hd0 "write -P 
qemu-io ide0-hd0 "write -P 
0qemu-io ide0-hd0 "write -P 
0xqemu-io ide0-hd0 "write -P 
0x3qemu-io ide0-hd0 "w!
  rite -P 0x33
[Dqemu-io ide0-hd0 "write -P 0x33 
qemu-io 
ide0-hd0 "write -P 0x33 
0qemu-io 
ide0-hd0 "write -P 0x33 0 
qemu-io 
ide0-hd0 "write -P 0x33 0 
4qemu-io
 ide0-hd0 "write -P 0x33 0 
4kqemu-io
 ide0-hd0 "write -P 0x33 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) 
ccocomcommcommicommitcommit
 commit icommit 
idcommit 
idecommit 
ide0commit 
ide0-commit 
ide0-hcommit 
ide0-hdcommit ide0-hd0
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  *** done

Works fine here!

(For unknown reason, applying the iotest hunk didn't work for me, though.)

The lines are too long and therefore split in this mail, they need to be joined manually before applying the patch.

Max

reply via email to

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