14.9. Rebasing a Backing File of an Image
qemu-img rebasechanges the backing file of an image.
qemu-img rebase [-f fmt] [-t cache] [-p] [-u] -b backing_file [-F backing_fmt] filename
safemode is used by default and performs a real rebase operation. The new backing file may differ from the old one and the
qemu-img rebasecommand will take care of keeping the guest virtual machine-visible content of filename unchanged. In order to achieve this, any clusters that differ between backing_file and old backing file of filename are merged into filename before making any changes to the backing file.
safemode is an expensive operation, comparable to converting an image. The old backing file is required for it to complete successfully.
unsafemode is used if the -u option is passed to
qemu-img rebase. In this mode, only the backing file name and format of filename is changed, without any checks taking place on the file contents. Make sure the new backing file is specified correctly or the guest-visible content of the image will be corrupted.