From ea413be2146aa0fc1d90b3a2d8536876e938e700 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 31 Aug 2018 16:52:02 -0400 Subject: [PATCH] xmlbuilder: Rename get_xml_config -> get_xml The config part is redundant. Should have done this a long time ago --- tests/clonetest.py | 2 +- tests/interface.py | 2 +- tests/nodedev.py | 2 +- tests/storage.py | 4 +- tests/xmlconfig.py | 10 +-- tests/xmlparse.py | 128 ++++++++++++++++----------------- virt-xml | 10 +-- virtManager/addhardware.py | 6 +- virtManager/connection.py | 2 +- virtManager/createinterface.py | 8 +-- virtManager/createvol.py | 2 +- virtManager/domain.py | 10 +-- virtManager/libvirtobject.py | 10 +-- virtManager/snapshots.py | 8 +-- virtManager/storagebrowse.py | 2 +- virtinst/cloner.py | 2 +- virtinst/guest.py | 4 +- virtinst/interface.py | 2 +- virtinst/network.py | 2 +- virtinst/storage.py | 8 +-- virtinst/xmlbuilder.py | 10 +-- 21 files changed, 117 insertions(+), 117 deletions(-) diff --git a/tests/clonetest.py b/tests/clonetest.py index c5dc3020b..702cbd266 100644 --- a/tests/clonetest.py +++ b/tests/clonetest.py @@ -93,7 +93,7 @@ class TestClone(unittest.TestCase): if clone_disks_file: xml_clone_disks = "" for i in cloneobj.clone_disks: - xml_clone_disks += i.get_vol_install().get_xml_config() + xml_clone_disks += i.get_vol_install().get_xml() utils.diff_compare(xml_clone_disks, clone_disks_file) def _clone_define(self, filebase): diff --git a/tests/interface.py b/tests/interface.py index 467c1cc9a..a0019bc00 100644 --- a/tests/interface.py +++ b/tests/interface.py @@ -51,7 +51,7 @@ class TestInterfaces(unittest.TestCase): def define_xml(self, obj, compare=True): obj.validate() - xml = obj.get_xml_config() + xml = obj.get_xml() logging.debug("Defining interface XML:\n%s", xml) if compare: diff --git a/tests/nodedev.py b/tests/nodedev.py index a79d1f86e..0b2c28f59 100644 --- a/tests/nodedev.py +++ b/tests/nodedev.py @@ -85,7 +85,7 @@ class TestNodeDev(unittest.TestCase): dev = DeviceHostdev(self.conn) dev.set_from_nodedev(nodedev) - utils.diff_compare(dev.get_xml_config() + "\n", devfile) + utils.diff_compare(dev.get_xml() + "\n", devfile) def testSystemDevice(self): devname = "computer" diff --git a/tests/storage.py b/tests/storage.py index a812b9674..a0b2d50e3 100644 --- a/tests/storage.py +++ b/tests/storage.py @@ -52,7 +52,7 @@ def removePool(poolobj): def poolCompare(pool_inst): filename = os.path.join(basepath, pool_inst.name + ".xml") - out_expect = pool_inst.get_xml_config() + out_expect = pool_inst.get_xml() if not os.path.exists(filename): open(filename, "w").write(out_expect) @@ -93,7 +93,7 @@ def createVol(conn, poolobj, volname=None, input_vol=None, clone_vol=None): vol_inst.validate() filename = os.path.join(basepath, vol_inst.name + ".xml") - utils.diff_compare(vol_inst.get_xml_config(), filename) + utils.diff_compare(vol_inst.get_xml(), filename) return vol_inst.install(meter=False) diff --git a/tests/xmlconfig.py b/tests/xmlconfig.py index 111cdc84b..f36d526d9 100644 --- a/tests/xmlconfig.py +++ b/tests/xmlconfig.py @@ -132,27 +132,27 @@ class TestXMLMisc(unittest.TestCase): dev1.macaddr = "22:22:33:44:55:66" dev2 = virtinst.DeviceInterface(self.conn, - parsexml=dev1.get_xml_config()) + parsexml=dev1.get_xml()) dev2.source = None dev2.source = "foobr0" dev2.macaddr = "22:22:33:44:55:67" dev3 = virtinst.DeviceInterface(self.conn, - parsexml=dev1.get_xml_config()) + parsexml=dev1.get_xml()) dev3.source = None dev3.macaddr = "22:22:33:44:55:68" - utils.diff_compare(dev1.get_xml_config(), None, + utils.diff_compare(dev1.get_xml(), None, "\n" " \n" " \n" "\n") - utils.diff_compare(dev2.get_xml_config(), None, + utils.diff_compare(dev2.get_xml(), None, "\n" " \n" " \n" "\n") - utils.diff_compare(dev3.get_xml_config(), None, + utils.diff_compare(dev3.get_xml(), None, "\n" " \n" "\n") diff --git a/tests/xmlparse.py b/tests/xmlparse.py index 6fe9c9a71..ccf07542e 100644 --- a/tests/xmlparse.py +++ b/tests/xmlparse.py @@ -34,7 +34,7 @@ class XMLParseTest(unittest.TestCase): def _roundtrip_compare(self, filename): expectXML = sanitize_file_xml(open(filename).read()) guest = virtinst.Guest(self.conn, parsexml=expectXML) - actualXML = guest.get_xml_config() + actualXML = guest.get_xml() utils.diff_compare(actualXML, expect_out=expectXML) def _alter_compare(self, actualXML, outfile, support_check=None): @@ -179,7 +179,7 @@ class XMLParseTest(unittest.TestCase): check("policy", "force", "disable") rmfeat = guest.cpu.features[3] guest.cpu.remove_child(rmfeat) - self.assertEqual(rmfeat.get_xml_config(), + self.assertEqual(rmfeat.get_xml(), """\n""") guest.cpu.add_feature("addfeature") @@ -220,7 +220,7 @@ class XMLParseTest(unittest.TestCase): check("nosharepages", False, True) check("locked", False, True) - self._alter_compare(guest.get_xml_config(), outfile, + self._alter_compare(guest.get_xml(), outfile, support_check=[self.conn.SUPPORT_CONN_VMPORT, self.conn.SUPPORT_CONN_VMCOREINFO]) @@ -237,7 +237,7 @@ class XMLParseTest(unittest.TestCase): guest.remove_child(guest.seclabels[1]) - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterMinimalGuest(self): guest, outfile = self._get_test_content("change-minimal-guest") @@ -246,11 +246,11 @@ class XMLParseTest(unittest.TestCase): check("acpi", False, True) check("pae", False) self.assertTrue( - guest.features.get_xml_config().startswith("\n""" """\n""") d = virtinst.DeviceDisk(self.conn, parsexml=xml) self._set_and_check(d, "target", "hda", "hdb") - self.assertEqual(xml.replace("hda", "hdb"), d.get_xml_config()) + self.assertEqual(xml.replace("hda", "hdb"), d.get_xml()) def testAlterChars(self): guest, outfile = self._get_test_content("change-chars") @@ -495,7 +495,7 @@ class XMLParseTest(unittest.TestCase): self.assertEqual(channel3.get_xml_id(), "./devices/channel[3]") self.assertEqual(channel3.get_xml_idx(), 2) - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterControllers(self): guest, outfile = self._get_test_content("change-controllers") @@ -525,7 +525,7 @@ class XMLParseTest(unittest.TestCase): check("model", "ich9-ehci1", "ich9-uhci1") check("master_startport", 4, 2) - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterNics(self): guest, outfile = self._get_test_content("change-nics") @@ -577,7 +577,7 @@ class XMLParseTest(unittest.TestCase): check("instanceid", "09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b", "09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterInputs(self): guest, outfile = self._get_test_content("change-inputs") @@ -594,7 +594,7 @@ class XMLParseTest(unittest.TestCase): check("bus", "usb", "xen") check("bus", "xen", "usb") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterGraphics(self): guest, outfile = self._get_test_content("change-graphics") @@ -659,7 +659,7 @@ class XMLParseTest(unittest.TestCase): check("gl", None, True) check("rendernode", None, "/dev/dri/foo") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterVideos(self): guest, outfile = self._get_test_content("change-videos") @@ -684,7 +684,7 @@ class XMLParseTest(unittest.TestCase): check("vgamem", None, 8192) check("accel3d", None, True) - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterHostdevs(self): infile = "tests/xmlparse-xml/change-hostdevs-in.xml" @@ -745,7 +745,7 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(dev7) check("type", "storage") check("storage_block", "/dev/sdf", "/dev/fd0") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterWatchdogs(self): guest, outfile = self._get_test_content("change-watchdogs") @@ -755,7 +755,7 @@ class XMLParseTest(unittest.TestCase): check("model", "ib700", "i6300esb") check("action", "none", "poweroff") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterFilesystems(self): guest, outfile = self._get_test_content("change-filesystems") @@ -814,7 +814,7 @@ class XMLParseTest(unittest.TestCase): check("source", "/foo/bar.img", "/foo/bar.raw") check("readonly", False, True) - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterSounds(self): infile = "tests/xmlparse-xml/change-sounds-in.xml" @@ -835,7 +835,7 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(dev3) check("model", "ac97", "sb16") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterAddr(self): guest, outfile = self._get_test_content("change-addr") @@ -885,7 +885,7 @@ class XMLParseTest(unittest.TestCase): # memory devices? guest.remove_device(dev5) - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterSmartCard(self): guest, outfile = self._get_test_content("change-smartcard") @@ -900,7 +900,7 @@ class XMLParseTest(unittest.TestCase): check("mode", "passthrough", "host") check("type", "spicevmc", None) - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterRedirdev(self): guest, outfile = self._get_test_content("change-redirdev") @@ -916,7 +916,7 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(dev2) check("type", "tcp", "spicevmc") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterTPM(self): guest, outfile = self._get_test_content("change-tpm") @@ -928,7 +928,7 @@ class XMLParseTest(unittest.TestCase): check("model", "tpm-tis", "tpm-crb", "tpm-tis") check("device_path", "/dev/tpm0", "frob") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterRNG_EGD(self): guest, outfile = self._get_test_content("change-rng-egd") @@ -947,7 +947,7 @@ class XMLParseTest(unittest.TestCase): check("rate_bytes", "1234", "4321") check("rate_period", "2000", "2001") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAlterRNG_Random(self): guest, outfile = self._get_test_content("change-rng-random") @@ -959,7 +959,7 @@ class XMLParseTest(unittest.TestCase): check("model", "virtio", "virtio") check("device", "/dev/random", "/dev/hwrng") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testConsoleCompat(self): guest, outfile = self._get_test_content("console-compat") @@ -969,7 +969,7 @@ class XMLParseTest(unittest.TestCase): check("source_path", "/dev/pts/4") check("_tty", "/dev/pts/4", "foo", "/dev/pts/4") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testPanicDevice(self): guest, outfile = self._get_test_content("change-panic-device") @@ -979,7 +979,7 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(dev1) check("type", "isa", None, "isa") check("iobase", "0x505", None, "0x506") - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testQEMUXMLNS(self): basename = "change-xmlns-qemu" @@ -994,7 +994,7 @@ class XMLParseTest(unittest.TestCase): guest.xmlns_qemu.args.add_new().value = "additional-arg" arg0 = guest.xmlns_qemu.args[0] guest.xmlns_qemu.remove_child(guest.xmlns_qemu.args[0]) - self.assertEqual(arg0.get_xml_config(), + self.assertEqual(arg0.get_xml(), "\n") check = self._make_checker(guest.xmlns_qemu.envs[0]) @@ -1004,7 +1004,7 @@ class XMLParseTest(unittest.TestCase): env.name = "DISPLAY" env.value = "1:2" - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testAddRemoveDevices(self): guest, outfile = self._get_test_content("add-devices") @@ -1032,7 +1032,7 @@ class XMLParseTest(unittest.TestCase): guest.add_device(virtinst.DeviceSound(self.conn, parsexml="""""")) - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testChangeKVMMedia(self): guest, outfile = self._get_test_content("change-media", kvm=True) @@ -1063,7 +1063,7 @@ class XMLParseTest(unittest.TestCase): check("path", None, "/dev/disk-pool/diskvol1") disk.sync_path_props() - self._alter_compare(guest.get_xml_config(), outfile) + self._alter_compare(guest.get_xml(), outfile) def testChangeSnapshot(self): basename = "change-snapshot" @@ -1083,7 +1083,7 @@ class XMLParseTest(unittest.TestCase): check("name", "hda", "hdb") check("snapshot", "internal", "no") - utils.diff_compare(snap.get_xml_config(), outfile) + utils.diff_compare(snap.get_xml(), outfile) ################### @@ -1127,8 +1127,8 @@ class XMLParseTest(unittest.TestCase): check("name", "bond-brbond") self.assertEqual(len(child_iface.interfaces), 2) - utils.diff_compare(iface.get_xml_config(), outfile) - utils.test_create(self.conn, iface.get_xml_config(), "interfaceDefineXML") + utils.diff_compare(iface.get_xml(), outfile) + utils.test_create(self.conn, iface.get_xml(), "interfaceDefineXML") def testInterfaceBondArp(self): basename = "test-bond-arp" @@ -1146,8 +1146,8 @@ class XMLParseTest(unittest.TestCase): check("arp_target", "192.168.100.200", "1.2.3.4") check("arp_validate_mode", "backup", "active") - utils.diff_compare(iface.get_xml_config(), outfile) - utils.test_create(self.conn, iface.get_xml_config(), "interfaceDefineXML") + utils.diff_compare(iface.get_xml(), outfile) + utils.test_create(self.conn, iface.get_xml(), "interfaceDefineXML") def testInterfaceBondMii(self): basename = "test-bond-mii" @@ -1161,8 +1161,8 @@ class XMLParseTest(unittest.TestCase): check("mii_updelay", 12, 33) check("mii_carrier_mode", "netif", "ioctl") - utils.diff_compare(iface.get_xml_config(), outfile) - utils.test_create(self.conn, iface.get_xml_config(), "interfaceDefineXML") + utils.diff_compare(iface.get_xml(), outfile) + utils.test_create(self.conn, iface.get_xml(), "interfaceDefineXML") def testInterfaceVLAN(self): basename = "test-vlan" @@ -1174,8 +1174,8 @@ class XMLParseTest(unittest.TestCase): check("tag", 123, 456) check("parent_interface", "eth2", "foonew") - utils.diff_compare(iface.get_xml_config(), outfile) - utils.test_create(self.conn, iface.get_xml_config(), "interfaceDefineXML") + utils.diff_compare(iface.get_xml(), outfile) + utils.test_create(self.conn, iface.get_xml(), "interfaceDefineXML") ################# @@ -1202,8 +1202,8 @@ class XMLParseTest(unittest.TestCase): check("target_path", "/some/target/path", "/mnt/my/foo") check("source_name", None, "fooname") - utils.diff_compare(pool.get_xml_config(), outfile) - utils.test_create(self.conn, pool.get_xml_config(), "storagePoolDefineXML") + utils.diff_compare(pool.get_xml(), outfile) + utils.test_create(self.conn, pool.get_xml(), "storagePoolDefineXML") def testISCSIPool(self): basename = "pool-iscsi" @@ -1216,8 +1216,8 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(pool.hosts[0]) check("name", "some.random.hostname", "my.host") - utils.diff_compare(pool.get_xml_config(), outfile) - utils.test_create(self.conn, pool.get_xml_config(), "storagePoolDefineXML") + utils.diff_compare(pool.get_xml(), outfile) + utils.test_create(self.conn, pool.get_xml(), "storagePoolDefineXML") def testGlusterPool(self): if not self.conn.check_support(self.conn.SUPPORT_CONN_POOL_GLUSTERFS): @@ -1234,8 +1234,8 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(pool.hosts[0]) check("name", "some.random.hostname", "my.host") - utils.diff_compare(pool.get_xml_config(), outfile) - utils.test_create(self.conn, pool.get_xml_config(), "storagePoolDefineXML") + utils.diff_compare(pool.get_xml(), outfile) + utils.test_create(self.conn, pool.get_xml(), "storagePoolDefineXML") def testRBDPool(self): basename = "pool-rbd" @@ -1256,8 +1256,8 @@ class XMLParseTest(unittest.TestCase): hostobj.name = "frobber" hostobj.port = "5555" - utils.diff_compare(pool.get_xml_config(), outfile) - utils.test_create(self.conn, pool.get_xml_config(), "storagePoolDefineXML") + utils.diff_compare(pool.get_xml(), outfile) + utils.test_create(self.conn, pool.get_xml(), "storagePoolDefineXML") def testVol(self): basename = "pool-dir-vol" @@ -1281,7 +1281,7 @@ class XMLParseTest(unittest.TestCase): check("group", "10736", "10000") check("label", None, "foo.label") - utils.diff_compare(vol.get_xml_config(), outfile) + utils.diff_compare(vol.get_xml(), outfile) ################### @@ -1353,8 +1353,8 @@ class XMLParseTest(unittest.TestCase): check = self._make_checker(r) check("netmask", None, "foo", None) - utils.diff_compare(net.get_xml_config(), outfile) - utils.test_create(self.conn, net.get_xml_config(), "networkDefineXML") + utils.diff_compare(net.get_xml(), outfile) + utils.test_create(self.conn, net.get_xml(), "networkDefineXML") def testNetOpen(self): basename = "network-open" @@ -1379,8 +1379,8 @@ class XMLParseTest(unittest.TestCase): check("start", "192.168.100.128", "192.168.101.128") check("end", "192.168.100.254", "192.168.101.254") - utils.diff_compare(net.get_xml_config(), outfile) - utils.test_create(self.conn, net.get_xml_config(), "networkDefineXML") + utils.diff_compare(net.get_xml(), outfile) + utils.test_create(self.conn, net.get_xml(), "networkDefineXML") def testNetVfPool(self): basename = "network-vf-pool" @@ -1405,8 +1405,8 @@ class XMLParseTest(unittest.TestCase): check("slot", 0x10) check("function", 0x0) - utils.diff_compare(net.get_xml_config(), outfile) - utils.test_create(self.conn, net.get_xml_config(), "networkDefineXML") + utils.diff_compare(net.get_xml(), outfile) + utils.test_create(self.conn, net.get_xml(), "networkDefineXML") ############## @@ -1422,7 +1422,7 @@ class XMLParseTest(unittest.TestCase): guest.cpu.copy_host_cpu() guest.cpu.clear() - utils.diff_compare(guest.get_xml_config(), outfile) + utils.diff_compare(guest.get_xml(), outfile) def testDomainRoundtrip(self): # Make sure our XML engine doesn't mangle non-libvirt XML bits @@ -1430,4 +1430,4 @@ class XMLParseTest(unittest.TestCase): outfile = "tests/xmlparse-xml/domain-roundtrip.xml" guest = virtinst.Guest(self.conn, parsexml=open(infile).read()) - utils.diff_compare(guest.get_xml_config(), outfile) + utils.diff_compare(guest.get_xml(), outfile) diff --git a/virt-xml b/virt-xml index 9ee96e0e4..14dbca626 100755 --- a/virt-xml +++ b/virt-xml @@ -235,14 +235,14 @@ def define_changes(conn, inactive_xmlobj, devs, action, confirm): for dev in devs: setup_device(dev) - conn.defineXML(inactive_xmlobj.get_xml_config()) + conn.defineXML(inactive_xmlobj.get_xml()) print_stdout(_("Domain '%s' defined successfully.") % inactive_xmlobj.name) return True def update_changes(domain, devs, action, confirm): for dev in devs: - xml = dev.get_xml_config() + xml = dev.get_xml() if confirm: if action == "hotplug": @@ -276,7 +276,7 @@ def update_changes(domain, devs, action, confirm): def prepare_changes(xmlobj, options, parserclass): - origxml = xmlobj.get_xml_config() + origxml = xmlobj.get_xml() if options.edit != -1: devs = action_edit(xmlobj, options, parserclass) @@ -290,7 +290,7 @@ def prepare_changes(xmlobj, options, parserclass): devs = action_remove_device(xmlobj, options, parserclass) action = "hotunplug" - newxml = xmlobj.get_xml_config() + newxml = xmlobj.get_xml() diff = get_diff(origxml, newxml) if options.print_diff: @@ -427,7 +427,7 @@ def main(conn=None): devs = action_build_xml(conn, options, parserclass) for dev in devs: # pylint: disable=no-member - print_stdout(dev.get_xml_config()) + print_stdout(dev.get_xml()) return 0 if options.update: diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py index e6619d666..5c77b2bec 100644 --- a/virtManager/addhardware.py +++ b/virtManager/addhardware.py @@ -1071,7 +1071,7 @@ class vmmAddHardware(vmmGObjectUI): def _add_device(self): - xml = self._dev.get_xml_config() + xml = self._dev.get_xml() logging.debug("Adding device:\n%s", xml) if self._remove_usb_controller: @@ -1090,7 +1090,7 @@ class vmmAddHardware(vmmGObjectUI): controller = getattr(self._dev, "vmm_controller", None) if controller is not None: logging.debug("Adding controller:\n%s", - controller.get_xml_config()) + controller.get_xml()) # Hotplug device attach_err = False try: @@ -1443,7 +1443,7 @@ class vmmAddHardware(vmmGObjectUI): setattr(self._dev, param_name, val) # Dump XML for sanity checking - self._dev.get_xml_config() + self._dev.get_xml() def _validate_page_video(self): model = uiutil.get_list_selection(self.widget("video-model")) diff --git a/virtManager/connection.py b/virtManager/connection.py index 1ccbef62d..6434f6abc 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -1061,7 +1061,7 @@ class vmmConnection(vmmGObject): self._backend.daemon_version()) logging.debug("conn version=%s", self._backend.conn_version()) logging.debug("%s capabilities:\n%s", - self.get_uri(), self.caps.get_xml_config()) + self.get_uri(), self.caps.get_xml()) # Try to create the default storage pool # We want this before events setup to save some needless polling diff --git a/virtManager/createinterface.py b/virtManager/createinterface.py index 36deb7fe0..c47d990e9 100644 --- a/virtManager/createinterface.py +++ b/virtManager/createinterface.py @@ -930,9 +930,9 @@ class vmmCreateInterface(vmmGObjectUI): # elements that might cause netcf to choke on # for a sub-interface xml = vmmiface.get_xmlobj( - inactive=True).get_xml_config() + inactive=True).get_xml() else: - xml = row[INTERFACE_ROW_KEY].get_xml_config() + xml = row[INTERFACE_ROW_KEY].get_xml() child = Interface(self.conn.get_backend(), parsexml=xml) iobj.add_interface(child) @@ -979,7 +979,7 @@ class vmmCreateInterface(vmmGObjectUI): for proto in proto_xml: iobj.add_protocol(InterfaceProtocol( self.conn.get_backend(), - parsexml=proto.get_xml_config())) + parsexml=proto.get_xml())) if itype == Interface.INTERFACE_TYPE_BRIDGE: ret = self.validate_bridge(iobj) @@ -993,7 +993,7 @@ class vmmCreateInterface(vmmGObjectUI): if not ret: return ret - iobj.get_xml_config() + iobj.get_xml() iobj.validate() self.interface = iobj diff --git a/virtManager/createvol.py b/virtManager/createvol.py index 0bf247f2c..395939ede 100644 --- a/virtManager/createvol.py +++ b/virtManager/createvol.py @@ -50,7 +50,7 @@ class vmmCreateVolume(vmmGObjectUI): def show(self, parent): try: - parent_xml = self.parent_pool.xmlobj.get_xml_config() + parent_xml = self.parent_pool.xmlobj.get_xml() except Exception: logging.debug("Error getting parent_pool xml", exc_info=True) parent_xml = None diff --git a/virtManager/domain.py b/virtManager/domain.py index 5af6ee018..287a89df5 100644 --- a/virtManager/domain.py +++ b/virtManager/domain.py @@ -1011,7 +1011,7 @@ class vmmDomain(vmmLibvirtObject): if not self.is_active(): return - devxml = devobj.get_xml_config() + devxml = devobj.get_xml() logging.debug("attach_device with xml=\n%s", devxml) self._backend.attachDevice(devxml) @@ -1022,7 +1022,7 @@ class vmmDomain(vmmLibvirtObject): if not self.is_active(): return - devxml = devobj.get_xml_config() + devxml = devobj.get_xml() logging.debug("detach_device with xml=\n%s", devxml) self._backend.detachDevice(devxml) @@ -1030,7 +1030,7 @@ class vmmDomain(vmmLibvirtObject): if flags is None: flags = getattr(libvirt, "VIR_DOMAIN_DEVICE_MODIFY_LIVE", 1) - xml = devobj.get_xml_config() + xml = devobj.get_xml() logging.debug("update_device with xml=\n%s", xml) self._backend.updateDeviceFlags(xml, flags) @@ -1965,7 +1965,7 @@ class vmmDomainVirtinst(vmmDomain): def _XMLDesc(self, flags): ignore = flags - return self._backend.get_xml_config() + return self._backend.get_xml() def _define(self, xml): ignore = xml @@ -1977,7 +1977,7 @@ class vmmDomainVirtinst(vmmDomain): def _make_xmlobj_to_define(self): if not self._orig_xml: - self._orig_xml = self._backend.get_xml_config() + self._orig_xml = self._backend.get_xml() return self._backend def _redefine_xmlobj(self, xmlobj, origxml=None): diff --git a/virtManager/libvirtobject.py b/virtManager/libvirtobject.py index c933253fc..3cb10064d 100644 --- a/virtManager/libvirtobject.py +++ b/virtManager/libvirtobject.py @@ -112,9 +112,9 @@ class vmmLibvirtObject(vmmGObject): logging.debug("Changing %s name from %s to %s", self, oldname, newname) - origxml = xmlobj.get_xml_config() + origxml = xmlobj.get_xml() xmlobj.name = newname - newxml = xmlobj.get_xml_config() + newxml = xmlobj.get_xml() try: self._key = newname @@ -293,7 +293,7 @@ class vmmLibvirtObject(vmmGObject): """ origxml = None if self._xmlobj: - origxml = self._xmlobj.get_xml_config() + origxml = self._xmlobj.get_xml() self._invalidate_xml() active_xml = self._XMLDesc(self._active_xml_flags) @@ -371,9 +371,9 @@ class vmmLibvirtObject(vmmGObject): we detect the actual XML change and log it correctly. """ if not origxml: - origxml = self._make_xmlobj_to_define().get_xml_config() + origxml = self._make_xmlobj_to_define().get_xml() - newxml = xmlobj.get_xml_config() + newxml = xmlobj.get_xml() self.log_redefine_xml_diff(self, origxml, newxml) if origxml != newxml: diff --git a/virtManager/snapshots.py b/virtManager/snapshots.py index afbbacebe..fc380c2e9 100644 --- a/virtManager/snapshots.py +++ b/virtManager/snapshots.py @@ -466,7 +466,7 @@ class vmmSnapshotPage(vmmGObjectUI): newsnap.name = name newsnap.description = desc or None newsnap.validate() - newsnap.get_xml_config() + newsnap.get_xml() return newsnap except Exception as e: return self.err.val_err(_("Error validating snapshot: %s") % e) @@ -513,7 +513,7 @@ class vmmSnapshotPage(vmmGObjectUI): if not snap: return - xml = snap.get_xml_config() + xml = snap.get_xml() name = snap.name mime, sndata = self._get_screenshot_data_for_save() self._snapshot_new_close() @@ -537,9 +537,9 @@ class vmmSnapshotPage(vmmGObjectUI): desc = desc_widget.get_buffer().get_property("text") or "" xmlobj = snap.get_xmlobj() - origxml = xmlobj.get_xml_config() + origxml = xmlobj.get_xml() xmlobj.description = desc - newxml = xmlobj.get_xml_config() + newxml = xmlobj.get_xml() self.vm.log_redefine_xml_diff(snap, origxml, newxml) if newxml == origxml: diff --git a/virtManager/storagebrowse.py b/virtManager/storagebrowse.py index 553edd441..c89400d5e 100644 --- a/virtManager/storagebrowse.py +++ b/virtManager/storagebrowse.py @@ -121,7 +121,7 @@ class vmmStorageBrowser(vmmGObjectUI): def _volume_chosen(self, src, volume): ignore = src - logging.debug("Chosen volume XML:\n%s", volume.xmlobj.get_xml_config()) + logging.debug("Chosen volume XML:\n%s", volume.xmlobj.get_xml()) self._finish(volume.get_target_path()) def _vol_sensitive_cb(self, fmt): diff --git a/virtinst/cloner.py b/virtinst/cloner.py index 3ece3073b..7bc189634 100644 --- a/virtinst/cloner.py +++ b/virtinst/cloner.py @@ -436,7 +436,7 @@ class Cloner(object): self._prepare_nvram() # Save altered clone xml - self._clone_xml = self._guest.get_xml_config() + self._clone_xml = self._guest.get_xml() logging.debug("Clone guest xml is\n%s", self._clone_xml) def start_duplicate(self, meter=None): diff --git a/virtinst/guest.py b/virtinst/guest.py index 63ec1a2e6..73007867f 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -325,7 +325,7 @@ class Guest(XMLBuilder): self.on_reboot = "destroy" self._set_osxml_defaults() - return self.get_xml_config() + return self.get_xml() ########################### @@ -867,7 +867,7 @@ class Guest(XMLBuilder): if not self.conn.is_test() and not self.conn.is_qemu(): return - if (self.cpu.get_xml_config().strip() or + if (self.cpu.get_xml().strip() or self.cpu.special_mode_was_set): # User already configured CPU return diff --git a/virtinst/interface.py b/virtinst/interface.py index 623f78706..21b9fcddd 100644 --- a/virtinst/interface.py +++ b/virtinst/interface.py @@ -238,7 +238,7 @@ class Interface(XMLBuilder): Install network interface xml. """ ignore = meter - xml = self.get_xml_config() + xml = self.get_xml() logging.debug("Creating interface '%s' with xml:\n%s", self.name, xml) diff --git a/virtinst/network.py b/virtinst/network.py index 5703b6e81..41c2b7b21 100644 --- a/virtinst/network.py +++ b/virtinst/network.py @@ -234,7 +234,7 @@ class Network(XMLBuilder): ################## def install(self, start=True, autostart=True): - xml = self.get_xml_config() + xml = self.get_xml() logging.debug("Creating virtual network '%s' with xml:\n%s", self.name, xml) diff --git a/virtinst/storage.py b/virtinst/storage.py index 3a46d42c6..cc58f5fc4 100644 --- a/virtinst/storage.py +++ b/virtinst/storage.py @@ -163,7 +163,7 @@ class StoragePool(_StorageObject): ret = [] sources = _EnumerateSources(conn, xml) for source in sources.sources: - source_xml = source.get_xml_config() + source_xml = source.get_xml() pool_xml = "\n%s\n" % ( util.xml_indent(source_xml, 2)) @@ -495,7 +495,7 @@ class StoragePool(_StorageObject): raise ValueError(_("Must explicitly specify disk format if " "formatting disk device.")) - xml = self.get_xml_config() + xml = self.get_xml() logging.debug("Creating storage pool '%s' with xml:\n%s", self.name, xml) @@ -713,7 +713,7 @@ class StorageVolume(_StorageObject): volxml = StorageVolume(self.conn, vol.XMLDesc(0)) volxml.pool = pool logging.debug("Found backing store volume XML:\n%s", - volxml.get_xml_config()) + volxml.get_xml()) if volxml.supports_property("format"): logging.debug("Returning format=%s", volxml.format) @@ -775,7 +775,7 @@ class StorageVolume(_StorageObject): if self.backing_store and not self.backing_format: self.backing_format = self._detect_backing_store_format() - xml = self.get_xml_config() + xml = self.get_xml() logging.debug("Creating storage volume '%s' with xml:\n%s", self.name, xml) diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py index e5eaa6caf..e02b42de6 100644 --- a/virtinst/xmlbuilder.py +++ b/virtinst/xmlbuilder.py @@ -302,7 +302,7 @@ class XMLProperty(_XMLPropertyBase): only if a default is registered, and only if the property was not already explicitly set by the API user. - This is called during the get_xml_config process and shouldn't + This is called during the get_xml process and shouldn't be called from outside this file. """ candefault, val = self._default_get_value(xmlbuilder) @@ -376,7 +376,7 @@ class XMLProperty(_XMLPropertyBase): """ Set the value at user request. This just stores the value in propstore. Setting the actual XML is only done at - get_xml_config time. + get_xml time. """ if _trackprops and not self._is_tracked: _seenprops.append(self) @@ -572,7 +572,7 @@ class XMLBuilder(object): # Public XML managing APIs # ############################ - def get_xml_config(self): + def get_xml(self): """ Return XML string of the object """ @@ -718,7 +718,7 @@ class XMLBuilder(object): object needs to have an associated mapping via XMLChildProperty """ xmlprop = self._find_child_prop(obj.__class__) - xml = obj.get_xml_config() + xml = obj.get_xml() xmlprop.append(self, obj) self._set_child_xpaths() @@ -738,7 +738,7 @@ class XMLBuilder(object): xmlprop.remove(self, obj) xpath = obj._xmlstate.abs_xpath() - xml = obj.get_xml_config() + xml = obj.get_xml() obj._set_xpaths(None, None) obj._parse_with_children(xml, None) self._xmlstate.xmlapi.node_force_remove(xpath)