'Copy data from backing chain into a new disk
This copies data from backing file(s) into overlay(s), giving
control over several aspects like what part of a disk image
chain to be copied, whether to reuse an existing destination
file, etc.  And updates the backing file to the new disk
:param shallow: Limit copy to top of the source backing chain
:param reuse_ext: Reuse an existing external file that was
pre-created
:param copy: Start a copy job
:param relative: Keep backing chain referenced using relative names
:param copy_dev: Treat the destination as type="block"'

def rebase(self, base, shallow=False, reuse_ext=False, copy=False, relative=False, copy_dev=False):

    flags = ((shallow and libvirt.VIR_DOMAIN_BLOCK_REBASE_SHALLOW) or 0)
    flags |= ((reuse_ext and libvirt.VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT) or 0)
    flags |= ((copy and libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY) or 0)
    flags |= ((copy_dev and libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY_DEV) or 0)
    flags |= ((relative and libvirt.VIR_DOMAIN_BLOCK_REBASE_RELATIVE) or 0)
    return self._guest._domain.blockRebase(self._disk, base, self.REBASE_DEFAULT_BANDWIDTH, flags=flags)
