Commit Graph

75 Commits

Author SHA1 Message Date
Cole Robinson
86417d42ca osxml: Ensure kernel/initrd/dtb are absolute paths 2014-09-23 14:32:01 -04:00
Cole Robinson
052220cfc8 virtinst: Add DomainCapabilities parser 2014-09-17 18:29:24 -04:00
Cole Robinson
eb7612356e virtinst: Switch to relative imports, fix cyclic import warnings 2014-09-12 16:28:38 -04:00
Chen Hanxiao
75d43f6a37 fix some missed binary prefixes for units
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-17 09:33:14 +08:00
Cole Robinson
a398d245cb Clean up pylint integration
- Drop no longer needed disable= bits
- Use string names for all skipped pylint messages
2014-04-02 19:00:24 -04:00
Cole Robinson
0b94c83beb xmlbuilder: Actually import logging 2014-02-25 14:56:54 -05:00
Cole Robinson
87c2ff1a14 xmlbuilder: Log broken XML if we can't parse it
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1066564
2014-02-25 12:45:15 -05:00
Cole Robinson
d76aab264e tests: Only use one env variable to notify we are running tests 2014-02-10 14:47:20 -05:00
Cole Robinson
dde460e399 xmlbuilder: Fix adding devices with child properties
And test it
2014-01-27 19:55:37 -05:00
Cole Robinson
9f5a842a3a xmlbuilder: Make clear() remove unknown XML properties 2014-01-25 17:20:30 -05:00
Cole Robinson
16c8c31cbd xmlbuilder: Remove unneeded argument to _remove_xpath_node 2014-01-25 17:20:30 -05:00
Cole Robinson
5edf4de058 xmlbuilder: Only pass xml context to _remove_xpath_node
Was confusing otherwise, and can give us a speedup.
2014-01-25 17:20:29 -05:00
Cole Robinson
5c762a9851 simplify remove_ node args 2014-01-25 17:20:29 -05:00
Cole Robinson
329ebe0746 xmlbuilder: Remove some unneeded redirection 2014-01-25 17:20:29 -05:00
Giuseppe Scrivano
2a040ccd17 mass update: remove double spaces from comments
Updated by this script:

find -name '*.py' -exec sed -i "s|^\(#.*[^.?\!]\)  \(.*[^#]\)$|\1 \2|g" \{\} \;

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:31 +01:00
Cole Robinson
3f532fe263 VirtualDisk: Handle the blktap default
And cache the blktap lookup once for the localhost
2013-10-06 13:17:35 -04:00
Cole Robinson
9ec845af03 xmlbuilder: Unify make_xpath callbacks 2013-09-24 09:25:05 -04:00
Cole Robinson
b690557a53 Convert NodeDevice to XMLBuilder 2013-09-23 08:25:20 -04:00
Cole Robinson
1c0475feff xmlbuilder: Make prop cache work with subclasses 2013-09-23 07:38:22 -04:00
Cole Robinson
cadf5ba770 xmlbuilder: Cache class property maps
Shaves about 20 seconds off the test suite
2013-09-20 11:30:33 -04:00
Cole Robinson
85e81df01a xmlbuilder: Serialize child objects even if they aren't in PROP_ORDER
This was just a bug
2013-09-20 11:17:11 -04:00
Cole Robinson
a23f1794d0 guest stuff 2013-09-20 10:55:48 -04:00
Cole Robinson
aff0ddb259 Use XMLBuilder for Storage object handling
Simplify the API a bunch while we are at it, add tests, etc.
2013-09-20 10:00:08 -04:00
Cole Robinson
3db5cb5f06 Use XMLBuilder for Interface XML
So we unify parsing and building the XML.

Since we already do this for vmmDomain, take the opportunity to move
the shared infrastructure into vmmLibvirtObject
2013-09-19 16:56:38 -04:00
Cole Robinson
cb06f7eb3d xmlbuilder: Ensure top level XML objects always end with a newline 2013-09-19 13:48:28 -04:00
Cole Robinson
1aaf41b201 xmlbuilder: A couple optimizations
This brings the test suite back to pre-refactor speeds
2013-09-19 13:31:33 -04:00
Cole Robinson
0be727e6bb xmlbuilder: Track singleton child properties explicitly
Things like Guest.Seclabel, VirtualDevice.VirtualAlias, etc.

Now we don't need to track a full xpath with each class, just its root
name and we build its hierarchy depending on its parent.
2013-09-19 13:31:33 -04:00
Cole Robinson
f5dab5cdfa xmlbuilder: Distinguish between parent xpath and object xpath
We want to add support for nested objects, like child interfaces
in virInterface definition. To do that we need to distinguish between
parent xpath and relative object path.

This causes a 10-15% slow down in the unit test suite for me. There's
probably opportunities for speeding this up.
2013-09-11 11:28:27 -04:00
Cole Robinson
eb4068cc47 xmlbuilder: Add infrastructure for parsing into subclasses
We already had this open coded in several classes with varying methods.
Now all someone has to do is

features = XMLChildProperty(CPUFeature)

The xmlbuilder code will pull the relevant xpath from the CPUFeature class,
handling parsing into instances of that class directly. The only
thing that needs to be manually added is the add_* remove_* functions.
2013-09-10 21:34:45 -04:00
Cole Robinson
10e608e9dd guest: Fix adding a parsed device to a built guest 2013-09-10 18:34:36 -04:00
Cole Robinson
37ec775daf xmlbuilder: Fix multiple overwrite of root_xpath
Nothing really triggers it right now, but future code may
2013-09-10 18:34:36 -04:00
Martin Kletzander
ab94df86c4 Typos fix and minor cleanup
Commit 57aab5de copy-pasted a typo, introduced a new one and used bad
order of parameters, so I'm fixing it so we're not stuck with it
forever.
2013-09-03 08:47:26 +02:00
Martin Kletzander
57aab5de17 Add support for multifunction address parameter 2013-09-03 08:08:06 +02:00
Cole Robinson
accff84ecc virtinst: Fix import ordering to standardize on relative imports
Kind of annoying that some imports were directly from files while
some were from the __init__.py convenience bits.
2013-08-08 20:49:50 -04:00
Cole Robinson
a23e30eb2d xmlbuilder: Fix clearing address.domain element
Our scheme for not unlinking a root node would cause issues if trying
to clear a @domain property when the root node was <domain>, even
if they are unrelated.
2013-07-29 10:45:37 -04:00
Cole Robinson
03bd6f024e xmlbuilder: Fix setting float value for is_int 2013-07-25 15:31:40 -04:00
Cole Robinson
695c4b7189 VirtualDisk: Make the driver/type auto changes opt-in
It was hard to get this right, so just require that any API users
which are changing the path of an existing disk call sync_path_props()
2013-07-25 15:04:47 -04:00
Cole Robinson
bdfb86fd06 xmlbuilder: Break out much of the xml handling to a separate class
Clears things up a bit.
2013-07-25 15:04:47 -04:00
Cole Robinson
bba3c93508 xmlbuilder: Always keep around an xml node, even if building from scratch
This further unifies the 'parse existing' vs. 'build new' case.
2013-07-25 10:59:23 -04:00
Cole Robinson
170595698e xmlbuilder: Drop is_tri property
It's a minor variation of is_bool which is better understood by using
defaults.
2013-07-24 12:51:53 -04:00
Cole Robinson
7a369a9802 xmlbuilder: Drop is_multi option
It complicates things quite a bit. And there's only one user, so just open
code it.
2013-07-24 12:36:44 -04:00
Cole Robinson
7411776c9a xmlbuilder: Simplify global XML vars
Just have classes specify a root XML path, and figure out root name,
indentation, and dumpxml path from there.
2013-07-24 12:36:10 -04:00
Cole Robinson
3cf7679beb Guest: Add get_install_xml for install handling 2013-07-24 11:32:30 -04:00
Cole Robinson
c7af25f7ae xmlbuilder: Drop cleanup_xml 2013-07-24 10:59:03 -04:00
Cole Robinson
e0190f7b5e XMLBuilder: Drop some is_parse checking 2013-07-24 10:40:35 -04:00
Cole Robinson
2ba3ec2684 Guest: Convert to new style XML prop, drop a bunch of XML infrastructure
Now every XML property is new style, without explicit local get/set
handlers. Drop a bunch of XML infrastructure that was helping with the
transition.
2013-07-24 07:54:04 -04:00
Cole Robinson
24e433a8de CPU: Convert to new style XML props 2013-07-23 17:34:33 -04:00
Cole Robinson
6af0848fb8 osxml: Convert to new style XML props 2013-07-23 17:34:33 -04:00
Cole Robinson
6127cac414 xmlbuilder: Allow is_int with custom converter options 2013-07-23 17:34:33 -04:00
Cole Robinson
aba9d82bac xmlbuilder: Improve error report if we might unlink root node 2013-07-23 17:34:32 -04:00