summaryrefslogtreecommitdiff
path: root/block/qapi.c
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2016-02-25 12:27:27 -0500
committerKevin Wolf <kwolf@redhat.com>2016-03-14 16:46:42 +0100
commitc540d53ac849f385521acb7552ade4f6d3f55ca6 (patch)
tree9ea32123150e33798746254206fe995c3488f059 /block/qapi.c
parentc21cc6ca989ebbeaed3e601ae4e521afbff5df54 (diff)
downloadqemu-c540d53ac849f385521acb7552ade4f6d3f55ca6.tar.gz
qemu-c540d53ac849f385521acb7552ade4f6d3f55ca6.tar.bz2
qemu-c540d53ac849f385521acb7552ade4f6d3f55ca6.zip
block/vpc: choose size calculation method based on creator_app field
The VHD file format is used by both Virtual PC, and Hyper-V. However, how the virtual disk size is calculated varies between the two. Virtual PC uses the CHS drive parameters to determine the drive size. Hyper-V, on the other hand, uses the current_size field in the footer when determining image size. This is problematic for a few reasons: * VHD images from Hyper-V, using CHS calculations, will likely be trunctated. * If we just rely always on current_size, then QEMU may have data compatibility issues with Virtual PC (we may write too much data into a VHD file to be used by Virtual PC, for instance). * Existing VHD images created by QEMU have used the CHS calculations, except for images exceeding the 127GB limit. We want to remain compatible with our own generated images. Luckily, the VHD specification defines a 'Creator App' field, that is used to indicate what software created the VHD file. This patch does two things: 1. Uses the 'Creator App' field to help determine how to calculate size, and 2. Adds a VPC format option 'force_size_calc', so that the user can override the 'Creator App' auto-detection, in case there exist VHD images with unknown or contradictory 'Creator App' entries. N.B.: We currently use the maximum CHS value as an indication to use the current_size field. This patch does not change that, even with the 'force_size_calc' option. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qapi.c')
0 files changed, 0 insertions, 0 deletions