From: Max Reitz <mreitz@redhat.com>
To: Jeff Cody <jcody@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, aik@ozlabs.ru,
den@openvz.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 1/4] block/vhdx.c: Don't blindly update the header
Date: Tue, 14 Nov 2017 16:17:32 +0100 [thread overview]
Message-ID: <fe1036ea-5bfe-1c9c-2821-ce62be865a92@redhat.com> (raw)
In-Reply-To: <659e4cdba6ef4c651737852777c8c93d27b38040.1510059970.git.jcody@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]
On 2017-11-07 14:10, Jeff Cody wrote:
> 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 <aik@ozlabs.ru>
> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
> block/vhdx.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/block/vhdx.c b/block/vhdx.c
> index 7ae4589..9956933 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);
And this doesn't even update the data GUID...
Max
> - if (ret < 0) {
> - goto fail;
> - }
> - }
> -
> /* TODO: differencing files */
>
> return 0;
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
next prev parent reply other threads:[~2017-11-14 15:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 13:10 [Qemu-devel] [PATCH v4 0/4] Don't write headers if BDS is INACTIVE Jeff Cody
2017-11-07 13:10 ` [Qemu-devel] [PATCH v4 1/4] block/vhdx.c: Don't blindly update the header Jeff Cody
2017-11-14 15:17 ` Max Reitz [this message]
2017-11-07 13:10 ` [Qemu-devel] [PATCH v4 2/4] block/parallels: Do not update header or truncate image when INMIGRATE Jeff Cody
2017-11-07 13:10 ` [Qemu-devel] [PATCH v4 3/4] block/parallels: add migration blocker Jeff Cody
2017-11-07 13:10 ` [Qemu-devel] [PATCH v4 4/4] qemu-iotests: update unsupported image formats in 194 Jeff Cody
2017-11-09 11:16 ` [Qemu-devel] [Qemu-block] [PATCH v4 0/4] Don't write headers if BDS is INACTIVE Stefan Hajnoczi
2017-11-09 16:11 ` [Qemu-devel] " Denis V. Lunev
2017-11-14 15:29 ` Max Reitz
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=fe1036ea-5bfe-1c9c-2821-ce62be865a92@redhat.com \
--to=mreitz@redhat.com \
--cc=aik@ozlabs.ru \
--cc=den@openvz.org \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).