cloner: get original XML with security informations

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1455491

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2017-09-15 18:34:58 +02:00
parent 6b8f0b6e1a
commit 8e0303059e
4 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,23 @@
<domain type='kvm'>
<name>clone-orig</name>
<uuid>aaa3ae22-fed2-bfbd-ac02-3bea3bcfad82</uuid>
<memory>262144</memory>
<currentMemory>262144</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='cdrom'/>
</os>
<features>
<acpi/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='foo'/>
</devices>
</domain>

View File

@ -0,0 +1,23 @@
<domain type="kvm">
<name>clone-new</name>
<uuid>12345678-1234-1234-1234-123456789012</uuid>
<memory>262144</memory>
<currentMemory>262144</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="i686" machine="pc">hvm</type>
<boot dev="cdrom"/>
</os>
<features>
<acpi/>
</features>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<input type="mouse" bus="ps2"/>
<graphics type="vnc" port="-1" autoport="yes" listen="127.0.0.1" passwd="foo"/>
</devices>
</domain>

View File

@ -187,3 +187,7 @@ class TestClone(unittest.TestCase):
def testCloneNvramNewpool(self):
base = "nvram-newpool"
self._clone_helper(base)
def testCloneGraphicsPassword(self):
base = "graphics-password"
self._clone_helper(base)

View File

@ -282,7 +282,8 @@ class Cloner(object):
if self.original_guest is not None and not self.original_xml:
self.original_dom = self._lookup_vm(self.original_guest)
self.original_xml = self.original_dom.XMLDesc(0)
flags = libvirt.VIR_DOMAIN_XML_SECURE
self.original_xml = self.original_dom.XMLDesc(flags)
logging.debug("Original XML:\n%s", self.original_xml)