From: Kevin Wolf <kwolf@redhat.com>
To: Jeff Cody <jcody@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, aik@ozlabs.ru,
mreitz@redhat.com, den@openvz.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/4] block/parallels: Don't update header until the first actual write
Date: Fri, 27 Oct 2017 11:09:19 +0200 [thread overview]
Message-ID: <20171027090919.GB3368@localhost.localdomain> (raw)
In-Reply-To: <2f0114c773e8fb917a7a54acccfd2e2adfb6e066.1509094209.git.jcody@redhat.com>
Am 27.10.2017 um 10:57 hat Jeff Cody geschrieben:
> The on disk image format 'inuse' header field is updated blindly if the
> image is opened RDWR. This can cause problems if the QEMU runstate is
> set to INMIGRATE, at which point the underlying file is set to INACTIVE.
> This causes an assert in bdrv_co_pwritev().
>
> Do something similar to what is done in VHDX; latch the first write, and
> update the header the first time we modify the file.
>
> Signed-off-by: Jeff Cody <jcody@redhat.com>
For VHDX, it seems that we have to have the header update in the write
path anyway, so it might be justifiable, but I think for parallels, it's
just ugly.
The conservative approach to this would be doing the header write in
.bdrv_open() only if BDRV_O_INACTIVE is cleared, and otherwise do it
during .bdrv_invalidate_cache().
By the way, random design thought: It might make sense to change
.bdrv_open() so that it always opens inactive images and then call
.bdrv_invalidate_cache() (possibly renamed to .bdrv_activate())
unconditionally even without migration.
Kevin
next prev parent reply other threads:[~2017-10-27 9:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 8:57 [Qemu-devel] [PATCH 0/4] Don't write headers if BDS is INACTIVE Jeff Cody
2017-10-27 8:57 ` [Qemu-devel] [PATCH 1/4] block/vhdx.c: Don't blindly update the header Jeff Cody
2017-10-27 8:57 ` [Qemu-devel] [PATCH 2/4] block/parallels: code movement Jeff Cody
2017-10-27 8:57 ` [Qemu-devel] [PATCH 3/4] block/parallels: Don't update header until the first actual write Jeff Cody
2017-10-27 9:09 ` Kevin Wolf [this message]
2017-10-27 10:18 ` Jeff Cody
2017-10-29 8:59 ` Kevin Wolf
2017-10-27 12:13 ` Denis V. Lunev
2017-10-27 8:57 ` [Qemu-devel] [PATCH 4/4] qemu-iotests: update unsupported image formats in 194 Jeff Cody
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=20171027090919.GB3368@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=aik@ozlabs.ru \
--cc=den@openvz.org \
--cc=jcody@redhat.com \
--cc=mreitz@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).