[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 11/19] block: vhdx write support
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v7 11/19] block: vhdx write support |
Date: |
Fri, 18 Oct 2013 15:25:50 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Oct 18, 2013 at 02:01:03PM +0200, Stefan Hajnoczi wrote:
> On Fri, Oct 11, 2013 at 02:17:31PM -0400, Jeff Cody wrote:
> > + /* check the payload block state */
> > + switch (s->bat[sinfo.bat_idx] & VHDX_BAT_STATE_BIT_MASK) {
> > + case PAYLOAD_BLOCK_ZERO:
> > + /* in this case, we need to preserve zero writes for
> > + * data that is not part of this write, so we must pad
> > + * the rest of the buffer to zeroes */
> > +
> > + /* if we are on a posix system with ftruncate() that
> > extends
> > + * a file, then it is zero-filled for us. On Win32, the
> > raw
> > + * layer uses SetFilePointer and SetFileEnd, which does not
> > + * zero fill AFAIK */
> > +
> > + /* Queue another write of zero buffers if the underlying
> > file
> > + * does not zero-fill on file extension */
> > +
> > + if (bdrv_has_zero_init(bs->file) == 0) {
>
> Maybe this should be done differently once Peter Lieven's thin
> provisioning patches are merged. I think bdrv_has_zero_init() only
> tells you whether the file is zeroed after creation. It doesn't
> guarantee zeroes for other operations like growing the file.
>
> I'm not 100% sure right now, will follow-up on this point later when
> I've reviewed Peter's series and thought more about it.
With Peter's thin provisioning patches this call would be changed to
bdrv_has_discard_zeroes(). We're discussing changing the name of that
function though.
Stefan
- [Qemu-devel] [PATCH v7 04/19] block: vhdx - log support struct and defines, (continued)
- [Qemu-devel] [PATCH v7 04/19] block: vhdx - log support struct and defines, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 05/19] block: vhdx - break endian translation functions out, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 07/19] block: vhdx code movement - move vhdx_close() above vhdx_open(), Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 06/19] block: vhdx - update log guid in header, and first write tracker, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 08/19] block: vhdx - log parsing, replay, and flush support, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 09/19] block: vhdx - add region overlap detection for image files, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 10/19] block: vhdx - add log write support, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 11/19] block: vhdx write support, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 12/19] block: vhdx - remove BAT file offset bit shifting, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 13/19] block: vhdx - move more endian translations to vhdx-endian.c, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 14/19] block: vhdx - break out code operations to functions, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 15/19] block: vhdx - fix comment typos in header, fix incorrect struct fields, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 16/19] block: vhdx - add .bdrv_create() support, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 17/19] block: vhdx - update _make_test_img() to filter out vhdx options, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 18/19] block: qemu-iotests for vhdx, add write test support, Jeff Cody, 2013/10/11
- [Qemu-devel] [PATCH v7 19/19] block: vhdx qemu-iotest - log replay of data sector, Jeff Cody, 2013/10/11