]> git.ipfire.org Git - thirdparty/qemu.git/commit
vmdk: fix cluster size check for flat extents
authorFam Zheng <famz@redhat.com>
Mon, 23 Sep 2013 09:18:29 +0000 (17:18 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 1 Oct 2013 03:34:36 +0000 (22:34 -0500)
commit61fbeb6e81f648d25c2d3ba5f0d663d54abed1c1
treebba177b981ee9e66ea3d4fa15807adbff155a8d3
parentfc06b430942e84a2a69e2a80a6d5b376a8064020
vmdk: fix cluster size check for flat extents

We use the extent size as cluster size for flat extents (where no L1/L2
table is allocated so it's safe) reuse sector calculating code with
sparse extents.

Don't pass in the cluster size for adding flat extent, just set it to
sectors later, then the cluster size checking will not fail.

The cluster_sectors is changed to int64_t to allow big flat extent.

Without this, flat extent opening is broken:

    # qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 100G
    Formatting '/tmp/a.vmdk', fmt=vmdk size=107374182400 compat6=off subformat='monolithicFlat' zeroed_grain=off
    # qemu-img info /tmp/a.vmdk
    image: /tmp/a.vmdk
    file format: raw
    virtual size: 0 (0 bytes)
    disk size: 4.0K

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 301c7d38a0c359b91526391d13617386f3d9bb29)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/vmdk.c