qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, gentoo.integer@gmail.com, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH v4 0/4] Fix conversion from ISO to VMDK streamOptimized
Date: Tue,  6 May 2014 21:08:42 +0800	[thread overview]
Message-ID: <1399381726-8078-1-git-send-email-famz@redhat.com> (raw)

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.

v4: Rename .is_compressed -> .needs_compressed_writes. (Stefan)
    has -> have in commit log in patch 3.

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(+)

-- 
1.9.2

             reply	other threads:[~2014-05-06 13:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06 13:08 Fam Zheng [this message]
2014-05-06 13:08 ` [Qemu-devel] [PATCH v4 1/4] qemu-img: Convert by cluster size if target is compressed Fam Zheng
2014-05-06 13:08 ` [Qemu-devel] [PATCH v4 2/4] vmdk: Implement .bdrv_write_compressed Fam Zheng
2014-05-06 13:08 ` [Qemu-devel] [PATCH v4 3/4] vmdk: Implement .bdrv_get_info() Fam Zheng
2014-05-06 13:08 ` [Qemu-devel] [PATCH v4 4/4] qemu-iotests: Test converting to streamOptimized from small cluster size Fam Zheng
2014-05-06 14:19 ` [Qemu-devel] [PATCH v4 0/4] Fix conversion from ISO to VMDK streamOptimized Stefan Hajnoczi

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=1399381726-8078-1-git-send-email-famz@redhat.com \
    --to=famz@redhat.com \
    --cc=gentoo.integer@gmail.com \
    --cc=kwolf@redhat.com \
    --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).