def rebase(self):
        """
        Change the backing-file entry of the exported disk.
        Please refer to 'qemu-img rebase' manual for more info.
        """
        if self.standalone:
            rebase_msg = 'Merging layered image with base'
        else:
            rebase_msg = 'Rebase'

        with LogTask(rebase_msg):
            if len(self.src_qemu_info) == 1:
                # Base image (doesn't have predecessors)
                return

            if self.standalone:
                # Consolidate the layers and base image
                utils.qemu_rebase(target=self.dst, backing_file="")
            else:
                if len(self.src_qemu_info) > 2:
                    raise utils.LagoUserException(
                        'Layered export is currently supported for one '
                        'layer only.  You can try to use Standalone export.'
                    )
                # Put an identifier in the metadata of the copied layer,
                # this identifier will be used later by Lago in order
                # to resolve and download the base image
                parent = self.src_qemu_info[0]['backing-filename']

                # Hack for working with lago images naming convention
                # For example: /var/lib/lago/store/phx_repo:el7.3-base:v1
                # Extract only the image name and the version
                # (in the example el7.3-base:v1)
                parent = os.path.basename(parent)
                try:
                    parent = parent.split(':', 1)[1]
                except IndexError:
                    pass

                parent = './{}'.format(parent)
                utils.qemu_rebase(
                    target=self.dst, backing_file=parent, safe=False
                )
Change the backing-file entry of the exported disk.
        Please refer to 'qemu-img rebase' manual for more info.