[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/20] block/vhdx.c: Don't blindly update the header
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PULL 17/20] block/vhdx.c: Don't blindly update the header |
Date: |
Tue, 14 Nov 2017 18:24:14 +0100 |
From: Jeff Cody <address@hidden>
The VHDX specification requires that before user data modification of
the vhdx image, the VHDX header file and data GUIDs need to be updated.
In vhdx_open(), if the image is set to RDWR, we go ahead and update the
header.
However, just because the image is set to RDWR does not mean we can go
ahead and write at this point - specifically, if the QEMU run state is
INMIGRATE, the underlying file BS may be set to inactive via the BDS
open flag of BDRV_O_INACTIVE. Attempting to write under this condition
will cause an assert in bdrv_co_pwritev().
We can alternatively latch the first time the image is written. And lo
and behold, we do just that, via vhdx_user_visible_write() in
vhdx_co_writev(). This means the call to vhdx_update_headers() in
vhdx_open() is likely just vestigial, and can be removed.
Reported-by: Alexey Kardashevskiy <address@hidden>
Tested-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Jeff Cody <address@hidden>
Message-id: address@hidden
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Denis V. Lunev <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/vhdx.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/block/vhdx.c b/block/vhdx.c
index 7ae4589879..9956933da6 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1008,13 +1008,6 @@ static int vhdx_open(BlockDriverState *bs, QDict
*options, int flags,
goto fail;
}
- if (flags & BDRV_O_RDWR) {
- ret = vhdx_update_headers(bs, s, false, NULL);
- if (ret < 0) {
- goto fail;
- }
- }
-
/* TODO: differencing files */
return 0;
--
2.13.6
- [Qemu-devel] [PULL 06/20] qcow2: Add iotest for an empty refcount table, (continued)
- [Qemu-devel] [PULL 06/20] qcow2: Add iotest for an empty refcount table, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 07/20] qcow2: Assert that the crypto header does not overlap other metadata, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 09/20] iotests: Add missing 'blkdebug::' in 040, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 08/20] iotests: Make 030 less flaky, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 10/20] iotests: Make 055 less flaky, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 11/20] iotests: Make 083 less flaky, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 12/20] iotests: Make 136 less flaky, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 13/20] iotests: Use new-style NBD connections, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 14/20] qcow2: Check that corrupted images can be repaired in iotest 060, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 15/20] block/snapshot: dirty all dirty bitmaps on snapshot-switch, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 17/20] block/vhdx.c: Don't blindly update the header,
Max Reitz <=
- [Qemu-devel] [PULL 20/20] qemu-iotests: update unsupported image formats in 194, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 18/20] block/parallels: Do not update header or truncate image when INMIGRATE, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 16/20] iotests: 077: Filter out 'resume' lines, Max Reitz, 2017/11/14
- [Qemu-devel] [PULL 19/20] block/parallels: add migration blocker, Max Reitz, 2017/11/14
- Re: [Qemu-devel] [PULL 00/20] Block patches for 2.11.0-rc1, Peter Maydell, 2017/11/14
- Re: [Qemu-devel] [PULL 00/20] Block patches for 2.11.0-rc1, Peter Maydell, 2017/11/14