qemu-img: Allow rebase with no input base
commit35ddd9300b81b70171da10134c36a7e22c845f16
authorMax Reitz <mreitz@redhat.com>
Thu, 9 May 2019 17:52:35 +0000 (9 19:52 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 10 May 2019 14:45:40 +0000 (10 16:45 +0200)
tree27b5a96368c48bdc1cc40bb7aded8d19e7f0dd62
parent433e8e3b22021027ab8bc27f6fefa132fb33bfed
qemu-img: Allow rebase with no input base

Currently, without -u, you cannot add a backing file to an image when it
currently has none:

$ qemu-img rebase -b base.qcow2 foo.qcow2
qemu-img: Could not open old backing file '': The 'file' block driver
requires a file name

It is really simple to allow this, though (effectively by setting
old_backing_size to 0), so this patch does just that.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c