qemu-e2k/block
Jeff Cody fb9245c261 block/vpc: give option to force the current_size field in .bdrv_create
When QEMU creates a VHD image, it goes by the original spec,
calculating the current_size based on the nearest CHS geometry (with an
exception for disks > 127GB).

Apparently, Azure will only allow images that are sized to the nearest
MB, and the current_size as calculated from CHS cannot guarantee that.

Allow QEMU to create images similar to how Hyper-V creates images, by
setting current_size to the specified virtual disk size.  This
introduces an option, force_size, to be passed to the vpc format during
image creation, e.g.:

    qemu-img convert -f raw -o force_size -O vpc test.img test.vhd

When using the "force_size" option, the creator app field used by
QEMU will be "qem2" instead of "qemu", to indicate the difference.
In light of this, we also add parsing of the "qem2" field during
vpc_open.

Bug reference: https://bugs.launchpad.net/qemu/+bug/1490611

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-03-14 16:46:42 +01:00
..
Makefile.objs block: convert quorum blockdrv to use crypto APIs 2015-07-08 13:11:01 +02:00
accounting.c block: Clean up includes 2016-01-20 13:36:23 +01:00
archipelago.c block: Clean up includes 2016-01-20 13:36:23 +01:00
backup.c block/backup: avoid copying less than full target clusters 2016-02-29 14:55:14 -05:00
blkdebug.c block: Clean up includes 2016-01-20 13:36:23 +01:00
blkverify.c block: Clean up includes 2016-01-20 13:36:23 +01:00
block-backend.c block: Add blk_remove_all_bs() 2016-02-02 17:50:46 +01:00
bochs.c block: Clean up includes 2016-01-20 13:36:23 +01:00
cloop.c block: Clean up includes 2016-01-20 13:36:23 +01:00
commit.c block: Clean up includes 2016-01-20 13:36:23 +01:00
curl.c curl: add support for HTTP authentication parameters 2016-02-29 14:54:31 -05:00
dmg.c block: Clean up includes 2016-01-20 13:36:23 +01:00
gluster.c block: Clean up includes 2016-01-20 13:36:23 +01:00
io.c block: add missing call to bdrv_drain_recurse 2016-02-09 13:52:26 +00:00
iscsi.c iscsi: add support for getting CHAP password via QCryptoSecret API 2016-02-29 14:54:31 -05:00
linux-aio.c block: Clean up includes 2016-01-20 13:36:23 +01:00
mirror.c mirror: Add mirror_wait_for_io 2016-02-29 14:54:31 -05:00
nbd-client.c nbd: enable use of TLS with NBD block driver 2016-02-16 17:16:33 +01:00
nbd-client.h nbd: enable use of TLS with NBD block driver 2016-02-16 17:16:33 +01:00
nbd.c util: Shorten references into SocketAddress 2016-03-05 10:41:52 +01:00
nfs.c block/nfs: add support for setting debug level 2016-02-29 14:54:30 -05:00
null.c block: Clean up includes 2016-01-20 13:36:23 +01:00
parallels.c parallels: Assign bs->file->bs to file in parallels_co_get_block_status 2016-02-02 17:50:47 +01:00
qapi.c block/qapi: Include empty drives in query-blockstats 2016-03-14 16:46:42 +01:00
qcow.c qcow: Assign bs->file->bs to file in qcow_co_get_block_status 2016-02-02 17:50:47 +01:00
qcow2-cache.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qcow2-cluster.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qcow2-refcount.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qcow2-snapshot.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qcow2.c qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status 2016-02-02 17:50:47 +01:00
qcow2.h qcow2: Add function for refcount order amendment 2015-12-18 14:34:43 +01:00
qed-check.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qed-cluster.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qed-gencb.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qed-l2-cache.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qed-table.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qed.c qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status 2016-02-02 17:50:47 +01:00
qed.h qed: Really remove unused field QEDAIOCB.finished 2015-02-06 17:24:21 +01:00
quorum.c quorum: fix segfault when read fails in fifo mode 2016-02-22 09:49:46 +01:00
raw-aio.h linux-aio: drop return code from laio_io_unplug and ioq_submit 2014-12-12 16:57:55 +00:00
raw-posix.c raw: Assign bs to file in raw_co_get_block_status 2016-02-02 17:50:47 +01:00
raw-win32.c block: Clean up includes 2016-01-20 13:36:23 +01:00
raw_bsd.c raw: Assign bs to file in raw_co_get_block_status 2016-02-02 17:50:47 +01:00
rbd.c rbd: add support for getting password from QCryptoSecret object 2016-02-29 14:54:30 -05:00
sheepdog.c osdep: remove use of socket_error() from all code 2016-03-10 17:19:34 +00:00
snapshot.c block: Clean up includes 2016-01-20 13:36:23 +01:00
ssh.c block: Clean up includes 2016-01-20 13:36:23 +01:00
stream.c block: Clean up includes 2016-01-20 13:36:23 +01:00
throttle-groups.c block: Clean up includes 2016-01-20 13:36:23 +01:00
vdi.c vdi: Assign bs->file->bs to file in vdi_co_get_block_status 2016-02-02 17:50:47 +01:00
vhdx-endian.c block: Clean up includes 2016-01-20 13:36:23 +01:00
vhdx-log.c block: Clean up includes 2016-01-20 13:36:23 +01:00
vhdx.c vhdx: Simplify vhdx_set_shift_bits() 2016-02-29 14:54:31 -05:00
vhdx.h block: vhdx - update PAYLOAD_BLOCK_UNMAPPED value to match 1.00 spec 2014-12-12 15:42:22 +00:00
vmdk.c vmdk: Return extent's file in bdrv_get_block_status 2016-02-02 17:50:47 +01:00
vpc.c block/vpc: give option to force the current_size field in .bdrv_create 2016-03-14 16:46:42 +01:00
vvfat.c block: Add "file" output parameter to block status query functions 2016-02-02 17:50:47 +01:00
win32-aio.c block: Clean up includes 2016-01-20 13:36:23 +01:00
write-threshold.c block: Clean up includes 2016-01-20 13:36:23 +01:00