* Re: [Qemu-devel] [PATCH v3 1/4] qemu-img: Convert by cluster size if target is compressed
[not found] ` <1398412852-2562-2-git-send-email-famz@redhat.com>
@ 2014-05-06 12:50 ` Stefan Hajnoczi
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-05-06 12:50 UTC (permalink / raw)
To: Fam Zheng; +Cc: kwolf, gentoo.integer, qemu-devel
On Fri, Apr 25, 2014 at 04:00:49PM +0800, Fam Zheng wrote:
> diff --git a/include/block/block.h b/include/block/block.h
> index b3230a2..8a1cb83 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -34,6 +34,10 @@ typedef struct BlockDriverInfo {
> * opened with BDRV_O_UNMAP flag for this to work.
> */
> bool can_write_zeroes_with_unmap;
> + /*
> + * True if the driver is writing data clusters compressed
> + */
> + bool is_compressed;
"is_compressed" is more general than what this flag actually
communicates:
/*
* True if this block driver only supports compressed writes
*/
bool needs_compressed_writes;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/4] Fix conversion from ISO to VMDK streamOptimized
[not found] <1398412852-2562-1-git-send-email-famz@redhat.com>
[not found] ` <1398412852-2562-2-git-send-email-famz@redhat.com>
@ 2014-05-06 12:52 ` Stefan Hajnoczi
2014-05-06 13:04 ` Fam Zheng
1 sibling, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-05-06 12:52 UTC (permalink / raw)
To: Fam Zheng; +Cc: kwolf, gentoo.integer, qemu-devel
On Fri, Apr 25, 2014 at 04:00:48PM +0800, Fam Zheng wrote:
> Previouly, convert from ISO to VMDK with subformat=streamOptimized fails:
>
> $ ./qemu-img convert -O vmdk -o subformat=streamOptimized foo.iso bar.vmdk
> VMDK: can't write to allocated cluster for streamOptimized
> qemu-img: error while writing sector 64: Input/output error
>
> Because current code in qemu-img.c uses the normal convert loop, rather than
> the compressed == true loop. In VMDK streamOptimized, writes must be in cluster
> granularity, because overlapped write to an allocated cluster is -EIO.
>
> This series adds is_compressed into BlockDriverInfo, and uses compressed
> convertion loop if the target block driver sets this field to true.
>
> It also implements .bdrv_get_info and .bdrv_write_compressed in VMDK driver to
> fit into this framework.
>
> Adds a test case to cover the code path in question: source image cluster size
> is smaller.
>
> v3: Finally revisit and address Stefan's review comments on v2 from 2 months
> ago. Sorry for being so slow on this one.
> The general approach is the same, changes include:
>
> - Split originial "[PATCH v2 5/5] mirror: Check for bdrv_get_info result" and
> send to list separately, because it's irrelevant with this series.
> - Don't report cluster_size in bdrv_get_info if it's a flat extent, no need
> to change type of BlockDriverInfo.cluster_size to 64 bits. So drop
> "[PATCH v2 3/5] block: Change BlockDriverInfo.cluster_size to 64 bits".
> - Add qemu-iotests case as [PATCH 4/4].
>
>
> Fam Zheng (4):
> qemu-img: Convert by cluster size if target is compressed
> vmdk: Implement .bdrv_write_compressed
> vmdk: Implement .bdrv_get_info()
> qemu-iotests: Test converting to streamOptimized from small cluster
> size
>
> block/vmdk.c | 35 +++++++++++++++++++++++++++++++++++
> include/block/block.h | 4 ++++
> qemu-img.c | 1 +
> tests/qemu-iotests/059 | 7 +++++++
> tests/qemu-iotests/059.out | 8 ++++++++
> 5 files changed, 55 insertions(+)
Looks good. I left a comment on Patch 1 asking you to rename the flag.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/4] Fix conversion from ISO to VMDK streamOptimized
2014-05-06 12:52 ` [Qemu-devel] [PATCH v3 0/4] Fix conversion from ISO to VMDK streamOptimized Stefan Hajnoczi
@ 2014-05-06 13:04 ` Fam Zheng
0 siblings, 0 replies; 3+ messages in thread
From: Fam Zheng @ 2014-05-06 13:04 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: kwolf, gentoo.integer, qemu-devel
On Tue, 05/06 14:52, Stefan Hajnoczi wrote:
> On Fri, Apr 25, 2014 at 04:00:48PM +0800, Fam Zheng wrote:
> > Previouly, convert from ISO to VMDK with subformat=streamOptimized fails:
> >
> > $ ./qemu-img convert -O vmdk -o subformat=streamOptimized foo.iso bar.vmdk
> > VMDK: can't write to allocated cluster for streamOptimized
> > qemu-img: error while writing sector 64: Input/output error
> >
> > Because current code in qemu-img.c uses the normal convert loop, rather than
> > the compressed == true loop. In VMDK streamOptimized, writes must be in cluster
> > granularity, because overlapped write to an allocated cluster is -EIO.
> >
> > This series adds is_compressed into BlockDriverInfo, and uses compressed
> > convertion loop if the target block driver sets this field to true.
> >
> > It also implements .bdrv_get_info and .bdrv_write_compressed in VMDK driver to
> > fit into this framework.
> >
> > Adds a test case to cover the code path in question: source image cluster size
> > is smaller.
> >
> > v3: Finally revisit and address Stefan's review comments on v2 from 2 months
> > ago. Sorry for being so slow on this one.
> > The general approach is the same, changes include:
> >
> > - Split originial "[PATCH v2 5/5] mirror: Check for bdrv_get_info result" and
> > send to list separately, because it's irrelevant with this series.
> > - Don't report cluster_size in bdrv_get_info if it's a flat extent, no need
> > to change type of BlockDriverInfo.cluster_size to 64 bits. So drop
> > "[PATCH v2 3/5] block: Change BlockDriverInfo.cluster_size to 64 bits".
> > - Add qemu-iotests case as [PATCH 4/4].
> >
> >
> > Fam Zheng (4):
> > qemu-img: Convert by cluster size if target is compressed
> > vmdk: Implement .bdrv_write_compressed
> > vmdk: Implement .bdrv_get_info()
> > qemu-iotests: Test converting to streamOptimized from small cluster
> > size
> >
> > block/vmdk.c | 35 +++++++++++++++++++++++++++++++++++
> > include/block/block.h | 4 ++++
> > qemu-img.c | 1 +
> > tests/qemu-iotests/059 | 7 +++++++
> > tests/qemu-iotests/059.out | 8 ++++++++
> > 5 files changed, 55 insertions(+)
>
> Looks good. I left a comment on Patch 1 asking you to rename the flag.
>
Thanks, will respin and send another revision soon.
Fam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-06 13:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1398412852-2562-1-git-send-email-famz@redhat.com>
[not found] ` <1398412852-2562-2-git-send-email-famz@redhat.com>
2014-05-06 12:50 ` [Qemu-devel] [PATCH v3 1/4] qemu-img: Convert by cluster size if target is compressed Stefan Hajnoczi
2014-05-06 12:52 ` [Qemu-devel] [PATCH v3 0/4] Fix conversion from ISO to VMDK streamOptimized Stefan Hajnoczi
2014-05-06 13:04 ` Fam Zheng
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).