mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Remove old 'Xen' class name back compat
This commit is contained in:
parent
3bce20d974
commit
b3779eec7d
@ -91,7 +91,7 @@ class TestImageParser(unittest.TestCase):
|
|||||||
g.installer = inst
|
g.installer = inst
|
||||||
g._prepare_install(None)
|
g._prepare_install(None)
|
||||||
|
|
||||||
actual_out = g.get_config_xml(install=False)
|
actual_out = g.get_xml_config(install=False)
|
||||||
expect_file = os.path.join(image2guestdir + fname)
|
expect_file = os.path.join(image2guestdir + fname)
|
||||||
expect_out = utils.read_file(expect_file)
|
expect_out = utils.read_file(expect_file)
|
||||||
expect_out = expect_out.replace("REPLACEME", os.getcwd())
|
expect_out = expect_out.replace("REPLACEME", os.getcwd())
|
||||||
|
@ -66,7 +66,7 @@ class TestXMLConfig(unittest.TestCase):
|
|||||||
|
|
||||||
guest._prepare_install(progress.BaseMeter())
|
guest._prepare_install(progress.BaseMeter())
|
||||||
try:
|
try:
|
||||||
actualXML = guest.get_config_xml(install=do_install,
|
actualXML = guest.get_xml_config(install=do_install,
|
||||||
disk_boot=do_disk_boot)
|
disk_boot=do_disk_boot)
|
||||||
|
|
||||||
if filename:
|
if filename:
|
||||||
@ -87,12 +87,6 @@ class TestXMLConfig(unittest.TestCase):
|
|||||||
wait = True
|
wait = True
|
||||||
dom = None
|
dom = None
|
||||||
|
|
||||||
old_getxml = guest.get_config_xml
|
|
||||||
def new_getxml(install=True, disk_boot=False):
|
|
||||||
xml = old_getxml(install, disk_boot)
|
|
||||||
return utils.sanitize_xml_for_define(xml)
|
|
||||||
guest.get_xml_config = new_getxml
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dom = guest.start_install(consolecb, meter, removeOld, wait)
|
dom = guest.start_install(consolecb, meter, removeOld, wait)
|
||||||
dom.destroy()
|
dom.destroy()
|
||||||
@ -103,9 +97,9 @@ class TestXMLConfig(unittest.TestCase):
|
|||||||
guest.installer._install_bootconfig.kernel = "kernel"
|
guest.installer._install_bootconfig.kernel = "kernel"
|
||||||
guest.installer._install_bootconfig.initrd = "initrd"
|
guest.installer._install_bootconfig.initrd = "initrd"
|
||||||
|
|
||||||
xmlinst = guest.get_config_xml(True, False)
|
xmlinst = guest.get_xml_config(True, False)
|
||||||
xmlboot = guest.get_config_xml(False, False)
|
xmlboot = guest.get_xml_config(False, False)
|
||||||
xmlcont = guest.get_config_xml(True, True)
|
xmlcont = guest.get_xml_config(True, True)
|
||||||
|
|
||||||
if instname:
|
if instname:
|
||||||
utils.diff_compare(xmlinst, instname)
|
utils.diff_compare(xmlinst, instname)
|
||||||
@ -356,7 +350,7 @@ class TestXMLConfig(unittest.TestCase):
|
|||||||
g.disks.append(utils.get_blkdisk())
|
g.disks.append(utils.get_blkdisk())
|
||||||
g.nics.append(utils.get_virtual_network())
|
g.nics.append(utils.get_virtual_network())
|
||||||
|
|
||||||
# Call get_config_xml sets first round of defaults w/o os_variant set
|
# Call get_xml_config sets first round of defaults w/o os_variant set
|
||||||
g.get_xml_config(do_install)
|
g.get_xml_config(do_install)
|
||||||
|
|
||||||
g.os_variant = "fedora11"
|
g.os_variant = "fedora11"
|
||||||
|
@ -35,7 +35,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
def _roundtrip_compare(self, filename):
|
def _roundtrip_compare(self, filename):
|
||||||
expectXML = sanitize_file_xml(file(filename).read())
|
expectXML = sanitize_file_xml(file(filename).read())
|
||||||
guest = virtinst.Guest(conn=conn, parsexml=expectXML)
|
guest = virtinst.Guest(conn=conn, parsexml=expectXML)
|
||||||
actualXML = guest.get_config_xml()
|
actualXML = guest.get_xml_config()
|
||||||
utils.diff_compare(actualXML, expect_out=expectXML)
|
utils.diff_compare(actualXML, expect_out=expectXML)
|
||||||
|
|
||||||
def _alter_compare(self, actualXML, outfile):
|
def _alter_compare(self, actualXML, outfile):
|
||||||
@ -163,7 +163,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check = self._make_checker(guest.get_devices("memballoon")[0])
|
check = self._make_checker(guest.get_devices("memballoon")[0])
|
||||||
check("model", "virtio", "none")
|
check("model", "virtio", "none")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterMinimalGuest(self):
|
def testAlterMinimalGuest(self):
|
||||||
infile = "tests/xmlparse-xml/change-minimal-guest-in.xml"
|
infile = "tests/xmlparse-xml/change-minimal-guest-in.xml"
|
||||||
@ -197,7 +197,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertTrue(guest.installer.get_xml_config().startswith("<os"))
|
self.assertTrue(guest.installer.get_xml_config().startswith("<os"))
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterBootMulti(self):
|
def testAlterBootMulti(self):
|
||||||
infile = "tests/xmlparse-xml/change-boot-multi-in.xml"
|
infile = "tests/xmlparse-xml/change-boot-multi-in.xml"
|
||||||
@ -212,7 +212,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("initrd", None, "bar.img")
|
check("initrd", None, "bar.img")
|
||||||
check("kernel_args", None, "ks=foo.ks")
|
check("kernel_args", None, "ks=foo.ks")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterBootKernel(self):
|
def testAlterBootKernel(self):
|
||||||
infile = "tests/xmlparse-xml/change-boot-kernel-in.xml"
|
infile = "tests/xmlparse-xml/change-boot-kernel-in.xml"
|
||||||
@ -228,7 +228,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("initrd", "/boot/initrd", None)
|
check("initrd", "/boot/initrd", None)
|
||||||
check("kernel_args", "location", None)
|
check("kernel_args", "location", None)
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterDisk(self):
|
def testAlterDisk(self):
|
||||||
"""
|
"""
|
||||||
@ -270,7 +270,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("driver_io", None, "threads")
|
check("driver_io", None, "threads")
|
||||||
check("driver_io", "threads", "native")
|
check("driver_io", "threads", "native")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testSingleDisk(self):
|
def testSingleDisk(self):
|
||||||
xml = ("""<disk type="file" device="disk"><source file="/a.img"/>"""
|
xml = ("""<disk type="file" device="disk"><source file="/a.img"/>"""
|
||||||
@ -336,7 +336,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("target_address", "1.2.3.4", "5.6.7.8")
|
check("target_address", "1.2.3.4", "5.6.7.8")
|
||||||
check("target_port", "4567", "1199")
|
check("target_port", "4567", "1199")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterControllers(self):
|
def testAlterControllers(self):
|
||||||
infile = "tests/xmlparse-xml/change-controllers-in.xml"
|
infile = "tests/xmlparse-xml/change-controllers-in.xml"
|
||||||
@ -371,7 +371,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check = self._make_checker(dev4.get_master())
|
check = self._make_checker(dev4.get_master())
|
||||||
check("startport", "4", "2")
|
check("startport", "4", "2")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterNics(self):
|
def testAlterNics(self):
|
||||||
infile = "tests/xmlparse-xml/change-nics-in.xml"
|
infile = "tests/xmlparse-xml/change-nics-in.xml"
|
||||||
@ -429,7 +429,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("instanceid", "09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b",
|
check("instanceid", "09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b",
|
||||||
"09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f")
|
"09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterInputs(self):
|
def testAlterInputs(self):
|
||||||
infile = "tests/xmlparse-xml/change-inputs-in.xml"
|
infile = "tests/xmlparse-xml/change-inputs-in.xml"
|
||||||
@ -449,7 +449,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("bus", "usb", "xen")
|
check("bus", "usb", "xen")
|
||||||
check("bus", "xen", "usb")
|
check("bus", "xen", "usb")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterGraphics(self):
|
def testAlterGraphics(self):
|
||||||
infile = "tests/xmlparse-xml/change-graphics-in.xml"
|
infile = "tests/xmlparse-xml/change-graphics-in.xml"
|
||||||
@ -493,7 +493,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("channel_record_mode", "any", "insecure")
|
check("channel_record_mode", "any", "insecure")
|
||||||
check("passwdValidTo", "2010-04-09T15:51:00", "2011-01-07T19:08:00")
|
check("passwdValidTo", "2010-04-09T15:51:00", "2011-01-07T19:08:00")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterVideos(self):
|
def testAlterVideos(self):
|
||||||
infile = "tests/xmlparse-xml/change-videos-in.xml"
|
infile = "tests/xmlparse-xml/change-videos-in.xml"
|
||||||
@ -518,7 +518,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check = self._make_checker(dev3)
|
check = self._make_checker(dev3)
|
||||||
check("model_type", "cirrus", "cirrus")
|
check("model_type", "cirrus", "cirrus")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterHostdevs(self):
|
def testAlterHostdevs(self):
|
||||||
infile = "tests/xmlparse-xml/change-hostdevs-in.xml"
|
infile = "tests/xmlparse-xml/change-hostdevs-in.xml"
|
||||||
@ -555,7 +555,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("slot", "0x2", "0x6")
|
check("slot", "0x2", "0x6")
|
||||||
check("function", "0x3", "0x7")
|
check("function", "0x3", "0x7")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterWatchdogs(self):
|
def testAlterWatchdogs(self):
|
||||||
infile = "tests/xmlparse-xml/change-watchdogs-in.xml"
|
infile = "tests/xmlparse-xml/change-watchdogs-in.xml"
|
||||||
@ -568,7 +568,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("model", "ib700", "i6300esb")
|
check("model", "ib700", "i6300esb")
|
||||||
check("action", "none", "poweroff")
|
check("action", "none", "poweroff")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterFilesystems(self):
|
def testAlterFilesystems(self):
|
||||||
devtype = "filesystem"
|
devtype = "filesystem"
|
||||||
@ -610,7 +610,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("wrpolicy", None, "immediate")
|
check("wrpolicy", None, "immediate")
|
||||||
check("readonly", False, True)
|
check("readonly", False, True)
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterSounds(self):
|
def testAlterSounds(self):
|
||||||
infile = "tests/xmlparse-xml/change-sounds-in.xml"
|
infile = "tests/xmlparse-xml/change-sounds-in.xml"
|
||||||
@ -631,7 +631,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check = self._make_checker(dev3)
|
check = self._make_checker(dev3)
|
||||||
check("model", "ac97", "sb16")
|
check("model", "ac97", "sb16")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterAddr(self):
|
def testAlterAddr(self):
|
||||||
infile = "tests/xmlparse-xml/change-addr-in.xml"
|
infile = "tests/xmlparse-xml/change-addr-in.xml"
|
||||||
@ -669,7 +669,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check = self._make_checker(dev3.alias)
|
check = self._make_checker(dev3.alias)
|
||||||
check("name", "channel0", "channel1")
|
check("name", "channel0", "channel1")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterSmartCard(self):
|
def testAlterSmartCard(self):
|
||||||
infile = "tests/xmlparse-xml/change-smartcard-in.xml"
|
infile = "tests/xmlparse-xml/change-smartcard-in.xml"
|
||||||
@ -687,7 +687,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check("mode", "passthrough", "host")
|
check("mode", "passthrough", "host")
|
||||||
check("type", "spicevmc", None)
|
check("type", "spicevmc", None)
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAlterRedirdev(self):
|
def testAlterRedirdev(self):
|
||||||
infile = "tests/xmlparse-xml/change-redirdev-in.xml"
|
infile = "tests/xmlparse-xml/change-redirdev-in.xml"
|
||||||
@ -705,7 +705,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check = self._make_checker(dev2)
|
check = self._make_checker(dev2)
|
||||||
check("type", "spicevmc")
|
check("type", "spicevmc")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testConsoleCompat(self):
|
def testConsoleCompat(self):
|
||||||
infile = "tests/xmlparse-xml/console-compat-in.xml"
|
infile = "tests/xmlparse-xml/console-compat-in.xml"
|
||||||
@ -717,7 +717,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
check = self._make_checker(dev1)
|
check = self._make_checker(dev1)
|
||||||
check("source_path", "/dev/pts/4")
|
check("source_path", "/dev/pts/4")
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testAddRemoveDevices(self):
|
def testAddRemoveDevices(self):
|
||||||
infile = "tests/xmlparse-xml/add-devices-in.xml"
|
infile = "tests/xmlparse-xml/add-devices-in.xml"
|
||||||
@ -737,7 +737,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
guest.remove_device(adddev)
|
guest.remove_device(adddev)
|
||||||
guest.add_device(adddev)
|
guest.add_device(adddev)
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
def testChangeKVMMedia(self):
|
def testChangeKVMMedia(self):
|
||||||
infile = "tests/xmlparse-xml/change-media-in.xml"
|
infile = "tests/xmlparse-xml/change-media-in.xml"
|
||||||
@ -768,7 +768,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
self._alter_compare(guest.get_config_xml(), outfile)
|
self._alter_compare(guest.get_xml_config(), outfile)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -1607,7 +1607,3 @@ def _wait_for_domain(conn, name):
|
|||||||
time.sleep(0.25)
|
time.sleep(0.25)
|
||||||
|
|
||||||
return dom
|
return dom
|
||||||
|
|
||||||
# Back compat class to avoid ABI break
|
|
||||||
XenGuest = Guest
|
|
||||||
Guest.get_config_xml = Guest.get_xml_config
|
|
||||||
|
@ -1874,10 +1874,3 @@ class VirtualDisk(VirtualDevice):
|
|||||||
self.target = t
|
self.target = t
|
||||||
return self.target
|
return self.target
|
||||||
raise ValueError(_("No more space for disks of type '%s'" % prefix))
|
raise ValueError(_("No more space for disks of type '%s'" % prefix))
|
||||||
|
|
||||||
|
|
||||||
class XenDisk(VirtualDisk):
|
|
||||||
"""
|
|
||||||
Back compat class to avoid ABI break.
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
@ -384,7 +384,3 @@ class VirtualNetworkInterface(VirtualDevice.VirtualDevice):
|
|||||||
xml += addr_xml
|
xml += addr_xml
|
||||||
xml += " </interface>"
|
xml += " </interface>"
|
||||||
return xml
|
return xml
|
||||||
|
|
||||||
# Back compat class to avoid ABI break
|
|
||||||
class XenNetworkInterface(VirtualNetworkInterface):
|
|
||||||
pass
|
|
||||||
|
@ -23,14 +23,13 @@ cliutils.setup_i18n()
|
|||||||
|
|
||||||
import Storage
|
import Storage
|
||||||
import Interface
|
import Interface
|
||||||
from Guest import Guest, XenGuest
|
from Guest import Guest
|
||||||
from VirtualDevice import VirtualDevice
|
from VirtualDevice import VirtualDevice
|
||||||
from VirtualNetworkInterface import VirtualNetworkInterface, \
|
from VirtualNetworkInterface import VirtualNetworkInterface
|
||||||
XenNetworkInterface
|
|
||||||
from VirtualGraphics import VirtualGraphics
|
from VirtualGraphics import VirtualGraphics
|
||||||
from VirtualAudio import VirtualAudio
|
from VirtualAudio import VirtualAudio
|
||||||
from VirtualInputDevice import VirtualInputDevice
|
from VirtualInputDevice import VirtualInputDevice
|
||||||
from VirtualDisk import VirtualDisk, XenDisk
|
from VirtualDisk import VirtualDisk
|
||||||
from VirtualHostDevice import (VirtualHostDevice, VirtualHostDeviceUSB,
|
from VirtualHostDevice import (VirtualHostDevice, VirtualHostDeviceUSB,
|
||||||
VirtualHostDevicePCI)
|
VirtualHostDevicePCI)
|
||||||
from VirtualCharDevice import VirtualCharDevice
|
from VirtualCharDevice import VirtualCharDevice
|
||||||
@ -57,19 +56,3 @@ from Seclabel import Seclabel
|
|||||||
from XMLBuilderDomain import XMLBuilderDomain
|
from XMLBuilderDomain import XMLBuilderDomain
|
||||||
import util
|
import util
|
||||||
import support
|
import support
|
||||||
|
|
||||||
# This represents the PUBLIC API. Any changes to these classes (or 'util.py')
|
|
||||||
# must be mindful of this fact.
|
|
||||||
__all__ = ["Guest", "XenGuest", "VirtualNetworkInterface",
|
|
||||||
"XenNetworkInterface", "VirtualGraphics", "VirtualAudio",
|
|
||||||
"VirtualDisk", "XenDisk", "FullVirtGuest", "ParaVirtGuest",
|
|
||||||
"DistroInstaller", "PXEInstaller", "LiveCDInstaller",
|
|
||||||
"ImportInstaller", "ImageInstaller", "CloneDesign",
|
|
||||||
"Storage", "Interface",
|
|
||||||
"User", "util", "support", "VirtualDevice", "Clock", "Seclabel",
|
|
||||||
"CPU",
|
|
||||||
"VirtualHostDevice", "VirtualHostDeviceUSB", "VirtualVideoDevice",
|
|
||||||
"VirtualHostDevicePCI", "VirtualCharDevice", "VirtualInputDevice",
|
|
||||||
"VirtualController", "VirtualWatchdog",
|
|
||||||
"VirtualFilesystem", "VirtualSmartCardDevice",
|
|
||||||
"VirtualHostDeviceUSBRedir", "VirtualMemballoon"]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user