]> git.ipfire.org Git - thirdparty/qemu.git/commit
vmdk: remove wrong calculation of relative path
authorFam Zheng <famz@redhat.com>
Wed, 26 Jun 2013 09:24:32 +0000 (17:24 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 12 Aug 2013 22:11:32 +0000 (17:11 -0500)
commitd306fd5f4ad5f0f168271a77d114931db7a337ea
treefd97fa932ea7da54c6b8f9ec6734351d17e7414a
parenteedc9f46cfae88428e31e809e396eacc5d800a4f
vmdk: remove wrong calculation of relative path

When creating image with backing file, the driver tries to calculate the
relative path from created image file to backing file, but the path
computation is incorrect. e.g.:

    $ qemu-img create -f vmdk -b vmdk-data-disk.vmdk vmdk-data-snapshot1
    Formatting 'vmdk-data-snapshot1', fmt=vmdk size=10737418240
    backing_file='vmdk-data-disk.vmdk' compat6=off zeroed_grain=off

    $ qemu-img info vmdk-data-snapshot1
    image: vmdk-data-snapshot1
    file format: vmdk
    virtual size: 10G (10737418240 bytes)
    disk size: 12K
->  backing file: disk.vmdk

The common part in file names, "vmdk-data-", is incorrectly forgotten by
relative_path(). As the VMDK specification has no restriction on
parentNameHint to be relative path, we simply remove this by using the
backing_file option.

Cc: qemu-stable@nongnu.org
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 8ed610a1c983dd2ed1eed8841036af55751d115f)

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