[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 0/4] qemu-img: add max-size subcommand
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [RFC 0/4] qemu-img: add max-size subcommand |
Date: |
Fri, 3 Mar 2017 15:48:23 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 03/03/2017 08:51 AM, Stefan Hajnoczi wrote:
> RFCv1:
> * Publishing patch series with just raw support, no qcow2 yet. Please review
> the command-line interface and let me know if you are happy with this
> approach.
>
> Users and management tools sometimes need to know the size required for a new
> disk image so that an LVM volume, SAN LUN, etc can be allocated ahead of time.
> Image formats like qcow2 have non-trivial metadata that makes it hard to
> estimate the exact size without knowledge of file format internals.
>
> This patch series introduces a new qemu-img subcommand that calculates the
> required size for both image creation and conversion scenarios.
>
> The conversion scenario is:
>
> $ qemu-img max-size -f raw -O qcow2 input.img
> 107374184448
>
> Here an existing image file is taken and the output includes the space
> required
> for data from the input image file.
>
> The creation scenario is:
>
> $ qemu-img max-size -O qcow2 --size 5G
> 196688
>
It looks sane to me, implementation looks clean enough.
Thanks!
> Stefan Hajnoczi (4):
> block: add bdrv_max_size() API
> raw-format: add bdrv_max_size() support
> qemu-img: add max-size subcommand
> iotests: add test 178 for qemu-img max-size
>
> include/block/block.h | 2 +
> include/block/block_int.h | 2 +
> block.c | 37 +++++++++
> block/raw-format.c | 16 ++++
> qemu-img.c | 196
> +++++++++++++++++++++++++++++++++++++++++++++
> qemu-img-cmds.hx | 6 ++
> tests/qemu-iotests/178 | 75 +++++++++++++++++
> tests/qemu-iotests/178.out | 25 ++++++
> tests/qemu-iotests/group | 1 +
> 9 files changed, 360 insertions(+)
> create mode 100755 tests/qemu-iotests/178
> create mode 100644 tests/qemu-iotests/178.out
>
- [Qemu-devel] [RFC 0/4] qemu-img: add max-size subcommand, Stefan Hajnoczi, 2017/03/03
- [Qemu-devel] [RFC 1/4] block: add bdrv_max_size() API, Stefan Hajnoczi, 2017/03/03
- [Qemu-devel] [RFC 2/4] raw-format: add bdrv_max_size() support, Stefan Hajnoczi, 2017/03/03
- [Qemu-devel] [RFC 3/4] qemu-img: add max-size subcommand, Stefan Hajnoczi, 2017/03/03
- [Qemu-devel] [RFC 4/4] iotests: add test 178 for qemu-img max-size, Stefan Hajnoczi, 2017/03/03
- Re: [Qemu-devel] [RFC 0/4] qemu-img: add max-size subcommand,
John Snow <=
- Re: [Qemu-devel] [RFC 0/4] qemu-img: add max-size subcommand, Nir Soffer, 2017/03/03
- Re: [Qemu-devel] [RFC 0/4] qemu-img: add max-size subcommand, Daniel P. Berrange, 2017/03/07