In the nova/virt/libvirt/driver.py file, the '_live_snapshot' and
'_swap_volume' methods have the following code flow
xml = dom.XMLDesc(0)
dom.undefine()
dom.blockRebase()
dom.defineXML(xml)
The reason for this is that 'blockRebase' requires the guest to be
transient, so we must temporarily delete the persistent config and
then re-create it later.
Unfortunately this code is using the wrong XML document when
re-creating the persistent config. 'dom.XMLDesc(0)' will return the
guest XML document based on the current guest state. Since the guest
is running in both these cases, it will get getting the *live* XML
instead of the persistent XML.So these methods are deleting the
persistent XML and replacing it with the live XML. These two
different XML documents are not guaranteed to contain the same
information.
As a second problem, it is not requesting inclusion of security
information, so any SPICE/VNC password set in the persistent XML
is getting lost.
Reviewed: https:/ /review. openstack. org/110346 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=5c3f212343d f997daa48f1f4a1 cdd2a29099c288
Committed: https:/
Submitter: Jenkins
Branch: master
commit 5c3f212343df997 daa48f1f4a1cdd2 a29099c288
Author: lvdongbing <email address hidden>
Date: Tue Jul 29 23:40:44 2014 +0800
libvirt re-define guest with wrong XML document
In the nova/virt/ libvirt/ driver. py file, the '_live_snapshot' and undefine( ) blockRebase( ) defineXML( xml)
'_swap_volume' methods have the following code flow
xml = dom.XMLDesc(0)
dom.
dom.
dom.
The reason for this is that 'blockRebase' requires the guest to be
transient, so we must temporarily delete the persistent config and
then re-create it later.
Unfortunately this code is using the wrong XML document when
re-creating the persistent config. 'dom.XMLDesc(0)' will return the
guest XML document based on the current guest state. Since the guest
is running in both these cases, it will get getting the *live* XML
instead of the persistent XML.So these methods are deleting the
persistent XML and replacing it with the live XML. These two
different XML documents are not guaranteed to contain the same
information.
As a second problem, it is not requesting inclusion of security
information, so any SPICE/VNC password set in the persistent XML
is getting lost.
Change-Id: I4b4e0990ca6c07 a9215766f994884 a1fb18f3a41
Closes-Bug: #1346191