Previously, in swap_volume, the VIR_DOMAIN_BLOCK_REBASE_COPY_DEV flag
was not passed to virDomainBlockRebase. In the case of iSCSI-backed
disks, this caused the XML to change from <source dev=/dev/iscsi/lun>
to <source file=/dev/iscsi/lun>. This was a problem because
/dev/iscsi/lun is not a regular file. This patch passes the
VIR_DOMAIN_BLOCK_REBASE_COPY_DEV flag to virDomainBlockRebase, causing
the correct <source dev=/dev/iscsi/lun> to be generated upon
volume-update.
Conflicts:
nova/tests/unit/virt/libvirt/test_driver.py
nova/virt/libvirt/driver.py
nova/virt/libvirt/guest.py
NOTE(mriedem): The conflicts are due to
fbcf8d6733 needing to translate
the exception message in driver.py and for passing instance
to disconnect_volume in test_driver, which was added in Pike with
b66b7d4f9d.
NOTE(artom): In stable/newton, the conflict in guest.py is due to a
different docstring for the rebase() method.
NOTE(artom): This backport squashes
5d5c5a5d92 to guard againt older libvirt
versions that don't have the VIR_DOMAIN_BLOCK_REBASE_COPY_DEV flag.
Change-Id: I868a0dae0baf8cded9c7c5807ea63ffc5eec0c5e
Closes-bug: 1691195
(cherry picked from commit a8a4a8ea7b)
(cherry picked from commit ef853e038d)