Commit Graph

219 Commits

Author SHA1 Message Date
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
43d15d67ac util: Have set_xml_path use xml_parse_wrapper 2013-07-24 12:08:00 -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
058100cdf8 xmlbuilder: Use shared clear() function 2013-07-24 10:47:40 -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
4e4ce6d395 DomainFeatures: Convert to new style XML props 2013-07-23 17:34:33 -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
09f47ad79e DomainNumatune: 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
012d1cdc52 Installer: Drop all XML handling, just have it setup install info 2013-07-23 17:34:33 -04:00
Cole Robinson
c0bdd24a55 Move all <os> bits to OSXML object, proxy through Installer
We want to remove all XML altering from the Installer, this is part one.
2013-07-23 17:34:33 -04:00
Cole Robinson
07215853b3 Installer: Drop hard to manage install_bootconfig 2013-07-23 17:34:33 -04:00
Cole Robinson
00d41be5c5 DistroInstaller: Bunch of misc cleanup 2013-07-23 17:34:32 -04:00
Cole Robinson
14103f175d VirtualConnection: Allow setting a display name for fake URIs 2013-07-23 17:34:32 -04:00
Cole Robinson
f37d4d010a virtinst: Drop __init__ params from Guest and Installer 2013-07-23 17:34:32 -04:00
Cole Robinson
aba9d82bac xmlbuilder: Improve error report if we might unlink root node 2013-07-23 17:34:32 -04:00
Cole Robinson
d9e82f984c VirtualDevice: Raise error if parsing addrstr fails 2013-07-23 17:34:32 -04:00
Cole Robinson
524d1047b1 Guest: Make API users opt in for default console/input devices
We don't need to maintain API back compat anymore
2013-07-23 17:34:32 -04:00
Cole Robinson
77c044932c virtinst: Move PXE, Import, and LiveCD installer to Installer.py
They are all trivial classes, no need to track in separate files.
2013-07-23 17:34:32 -04:00
Cole Robinson
20a0083635 Clock: Convert to new style XML props 2013-07-23 17:34:32 -04:00
Cole Robinson
b18a29d8ff xmlbuilder: Add explicit support for yes/no XML options 2013-07-23 17:34:32 -04:00
Cole Robinson
326731cfc5 xmlbuilder: Remove order_elements hack 2013-07-23 17:34:32 -04:00
Cole Robinson
510d28e33b Seclabel: Convert to new style XML props. 2013-07-23 17:34:31 -04:00
Cole Robinson
e802eae07b VirtualCharDevice: Convert to new style XML props, rework API 2013-07-23 17:34:31 -04:00
Martin Kletzander
b8a209ef9c virt-install: Make default graphics configurable
The '--default-graphics' option of 'setup.py configure' only affects
virt-manager, but not virt-install.  This should be unified, so this
patch checks whether default_graphics taken from the cli is supported
and uses that option.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=912615
2013-07-16 08:07:57 +02:00
Cole Robinson
4f7f9e2267 VirtualAudio: Convert to new style XML props 2013-07-15 22:00:08 -04:00
Cole Robinson
a9296ec3ae VirtualController: Convert to new style XML props 2013-07-15 21:52:18 -04:00
Cole Robinson
9c92d8e092 VirtualFilesystem: Convert to new style XML props 2013-07-15 20:53:46 -04:00
Cole Robinson
dc58d48a33 VirtualGraphics: Drop non-default __init__ params 2013-07-15 20:43:41 -04:00
Cole Robinson
75e34247f3 VirtualGraphics: Switch to new style XML props 2013-07-15 18:53:53 -04:00
Cole Robinson
f079ec36eb VirtualHostDevice: Convert to new style XML props 2013-07-15 17:45:43 -04:00
Cole Robinson
3bddccc3d6 VirtualInputDevice: Convert to new style xml props 2013-07-15 16:55:49 -04:00
Cole Robinson
e6e1036c59 VirtualMemballon: Convert to new style XML props 2013-07-15 16:55:32 -04:00
Cole Robinson
3ae835dc7c VirtualNetworkInterface: Drop all XML __init__ params 2013-07-15 14:14:05 -04:00
Cole Robinson
81cd055f9c VirtualNetworkInterface: Convert to new style XML props
Leave __init__ where it is for now though.
2013-07-15 13:59:09 -04:00
Cole Robinson
a75cb4074c VirtualPort: Convert to new style xml properties 2013-07-15 13:08:58 -04:00
Cole Robinson
98a4d86d7f VirtualRedir: Convert to new style XML props 2013-07-15 12:57:37 -04:00
Cole Robinson
b6f2d99db2 VirtualSmartCard: Convert to new style XML props 2013-07-15 12:36:57 -04:00
Cole Robinson
f3a37ba195 VirtualTPM: Convert to new style properties 2013-07-15 12:18:23 -04:00
Cole Robinson
e5a7fe6405 VirtualVideo: Convert to new style xml props 2013-07-15 11:19:18 -04:00
Cole Robinson
6f61e30b18 VirtualWatchdog: Convert to new style XML props 2013-07-15 11:11:16 -04:00
Cole Robinson
e5230e90e9 VirtualAddress: Convert to new style XML properties
This adds a bunch of extra XML parsing infrastructure to make everything
work the same.
2013-07-15 10:40:12 -04:00
Cole Robinson
7cfe4ddb4d VirtualDisk: Move xml cleanup to a global xmlbuilder hook 2013-07-14 18:31:33 -04:00
Cole Robinson
c7ca9c88e3 VirtualDisk: Convert path to new style XML property
Due to the complexity here, we hide the XML bits under _xmlpath, and use
path to cover the internal state integration.
2013-07-14 18:16:17 -04:00
Cole Robinson
13d8a4dae5 VirtualDisk: convert driver_type and driver_name to new style property 2013-07-14 18:16:01 -04:00
Cole Robinson
1a74a8fda6 VirtualDisk: Convert 'type' to new style XML property 2013-07-14 18:15:47 -04:00
Cole Robinson
ae74bd662f VirtualDisk: Convert device property to new implicit style 2013-07-14 17:15:12 -04:00
Cole Robinson
8ad9084e5f default rejiggering setup, no regression 2013-07-14 17:12:39 -04:00
Cole Robinson
2cea517823 xmlbuilder: Allow classes to specify order of certain xml elements
This will save us some test case churn. As an example, we now
do auto building of disk <target> XML and it doesn't alter things.
Without this bus and target are often swapped.
2013-07-14 16:45:28 -04:00
Cole Robinson
154bad0184 xmlbuilder: Simplify default getter/setter some more 2013-07-14 16:35:25 -04:00
Cole Robinson
2d460a98e5 xmlbuilder: Don't treat 0 as None in setter impl 2013-07-14 16:35:25 -04:00
Cole Robinson
9c5a1b60ee CloneManager: Make sure to sync driver_name 2013-07-14 16:35:25 -04:00
Cole Robinson
ed8d785eef VirtualDisk: Drop driver_name = "qemu" from set_defaults
Our property functions should already handle that.
2013-07-14 16:35:25 -04:00
Cole Robinson
70d34e928e VirtualDisk: Drop set_vol_object, it is barely used
And it complicates syncing state. Make points where we sync values
more explicit.
2013-07-14 16:35:09 -04:00
Cole Robinson
328f98272c xmlbuilder: Add plumbing to track if a property is unset 2013-07-14 16:35:09 -04:00
Cole Robinson
6506fb2995 VirtualDisk: Drop is_parse conditional if changing device
We can easily push this up to the caller, nothing really changes the
device of an existing device in practice.
2013-07-14 16:35:09 -04:00
Cole Robinson
d3dbbe9f54 xmlbuilder: Add explicit support for refreshing an XML prop 2013-07-14 16:34:54 -04:00
Cole Robinson
c12327cbd1 Guest: Switch memory units to KB to match default XML 2013-07-13 23:07:01 -04:00
Cole Robinson
69e1d66b53 xmlbuilder: Few misc cleanups and streamlinings 2013-07-13 22:51:54 -04:00
Cole Robinson
7d75a43e33 XMLProperty: Add convenience param is_int 2013-07-13 21:49:32 -04:00
Cole Robinson
5f58d05051 VirtualDisk: Convert more XMLProperties to the new world order 2013-07-13 21:40:54 -04:00
Cole Robinson
41afdfd9aa hostkeymap: Globally cache the host lookup
Rather than make the callers worry about it
2013-07-13 20:58:09 -04:00
Cole Robinson
ed826315a5 xmlbuilder: Simplify free'ing xpath contexts 2013-07-13 20:47:19 -04:00
Cole Robinson
02f35628fb VirtualDisk: Make get_xml_config not have side effects
Move all the defaults setting to a set_defaults function, wire it
up to Guest.get_xml_config.
2013-07-13 20:22:19 -04:00
Cole Robinson
e7b518cbff Guest: Drop validate_parms, it's not useful 2013-07-13 20:01:07 -04:00
Cole Robinson
e04dfdd4ff virtinst: Test rhel defaults, and make sure it doesn't break test suite 2013-07-13 20:01:07 -04:00
Cole Robinson
b152e83fef virtinst: Rename XMLBuilderDomain.py -> xmlbuilder.py
And XMLBuilderDomain -> XMLBuilder
And _xml_property -> XMLProperty
2013-07-13 18:57:24 -04:00
Cole Robinson
4d5ca0ae5a XMLBuilder: Simplify is_multi handling 2013-07-13 18:57:20 -04:00
Cole Robinson
d8c68e3495 XMLBuilder: Split up massive get/set helpers
This should be a no-op, just a big cleanup
2013-07-13 17:54:46 -04:00
Cole Robinson
4ce1774d53 VirtualDisk: Rework provisioning and validation behavior
We separate all the provisioning bits to diskbackend.py. VirtualDisk
users now need to explicitly opt in to storage creation by using
set_create_storage().

validation is no longer done automatically, users must call the
validation() command.

__init__ drops all extra parameters.

This will eventually get us to a point where we can unify the manual
XML building and XML parsing machinery, and get consistent validation
behavior between devices.
2013-07-13 16:37:33 -04:00
Cole Robinson
5962fde3e6 VirtualConnection: Fix uri helpers when we use the default empty URI 2013-07-13 16:32:21 -04:00
Cole Robinson
fbf2d9ee40 VirtualDisk: Convert simple props to unified parse/get/set 2013-07-12 15:26:51 -04:00
Cole Robinson
ce243314c0 tests: Verify that every new style XML prop is exercised
coverage isn't going to help us much here, so add some hacky infrastructure
to ensure that xmlparse.py is touching every new style xmlprop.
2013-07-12 15:19:37 -04:00
Cole Robinson
dcd632da80 XMLBuilder: Provide default fget and fset impls
This is the first step towards unifying the XML handling split between
parsing and creating from scratch. Demonstrate it with VirtualDisk.iotune
bits.
2013-07-12 14:41:29 -04:00
Cole Robinson
f620b317b9 tests: Make sure all XML use " for quoting
This is what libxml outputs with, and it's going to mess up
test output with upcoming tests.
2013-07-12 14:19:54 -04:00
Cole Robinson
0d5fe93048 Centralize XML helpers in virtinst/util.py 2013-07-12 13:10:23 -04:00
Cole Robinson
534e613d40 VirtualNetworkInterface: Absord MAC generating routines 2013-07-12 13:10:23 -04:00
Cole Robinson
f1b55090d2 VirtualDisk: Drop cache and io from __init__
They are barely used and can be specified separately.
2013-07-12 13:10:23 -04:00
Cole Robinson
57d4fcab33 VirtualDisk: Drop the volName parameter, it's not needed 2013-07-12 13:10:22 -04:00
Cole Robinson
c151b75896 XMLBuilder: Remove largely unused validation helpers
They aren't adding much value
2013-07-12 13:10:22 -04:00
Cole Robinson
318ba7e474 VirtualConnection: Deal with Guest objects, not raw XML
We already do XML parsing, no need to open code it elsewhere
2013-07-10 20:09:51 -04:00
Cole Robinson
97264a3dfe VirtualConnection: Some reorganizing to avoid circular references 2013-07-10 20:09:51 -04:00
Cole Robinson
3d1b1735ee XMLBuilder: Simplify XML deference
As long as we carry around a reference for every time we lookup
a sub node and use a wrapper class to do the free'ing, we should
be fine.
2013-07-10 20:09:51 -04:00
Martin Kletzander
f08313513b Use proper disk targets.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=968878

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2013-07-09 09:12:53 -04:00
Cole Robinson
7a2caee6e1 VirtualConnection: Allow using virt-manager object caches
So when we call into virtinst it doesn't do a whole round of object
lookup and XML fetching.
2013-07-07 18:54:08 -04:00
Cole Robinson
d386ba5d62 VirtualConnection: Add option to cache fetch_* results
We use this in the CLI tools since there's no point in repeatedly updating
the VM list if the whole process only takes a few seconds.
2013-07-07 16:38:11 -04:00
Cole Robinson
9d560f7d9a VirtualDisk: Always return VM names from is_conflict_disk 2013-07-07 16:34:46 -04:00
Cole Robinson
d5dc06148d virtinst: Move fetch_all_guests to connection object
And fetch_all_pools. And have it use pollhelpers
2013-07-07 15:14:59 -04:00
Cole Robinson
ee7d0b620d connection: Support listAll* object lookups
These calls save us a few API lookups, but are not supported by all
libvirt versions.

Since these bits were getting quite large, move them all to a separate
pollhelpers file.

However listAllInterfaces is returning an empty list for now, so we
disable the check: https://bugzilla.redhat.com/show_bug.cgi?id=982014
2013-07-07 15:06:09 -04:00
Cole Robinson
b7ee86541d virtManager: connection: Switch to tick() paradigm for all objects
This is going to be much slower than what we currently do, but we
will be trying to fix that shortly.
2013-07-07 08:44:46 -04:00
Cole Robinson
d427800f11 Share default_uri function 2013-07-06 20:09:18 -04:00
Cole Robinson
3692e98ba0 VirtualConnection: Cache conn support checks 2013-07-06 15:53:35 -04:00
Cole Robinson
c406a6433c VirtualConnection: cache version lookups 2013-07-06 15:39:00 -04:00
Cole Robinson
94f8d4cfa9 VirtualConnection: cache capabilities XML
This means we can drop passing around the pre-parsed caps info everywhere.
2013-07-06 14:12:13 -04:00