1433 Commits

Author SHA1 Message Date
Cole Robinson
01b665a6c3 urlfetcher: Throw error if iso _grabber file doesn't exist
isoinfo won't error here at least for me on Fedora 28, so
use hasFile to confirm
2018-03-28 14:02:23 -04:00
Cole Robinson
eee1caa946 domain: Drop most device list wrappers
There's lots of hacks stuffed into the domain device lists. Formalize
some of it, move some of the specific stuff to details.py, and drop
a lot of the needless API wrappers
2018-03-21 16:10:45 -04:00
Cole Robinson
4b26348290 xmlbuilder: Separate out the property cache
Add a few more mappings to simplify certain lookups, and add
some more validation to prevent programming errors
2018-03-21 14:32:47 -04:00
Cole Robinson
5b111b3d9f guest: Move get_all_devices to devices.get_all 2018-03-21 12:59:46 -04:00
Cole Robinson
7fb1ddbc18 virtinst: s/_XML_ROOT_NAME/XML_NAME/g
No reason for it to be privatized, could be useful in some cases
2018-03-21 11:17:36 -04:00
Cole Robinson
3e176f2aa4 xmlbuilder: Remove relative_xpath substitution support
This only has one user in interface.py. That case is indeed weird
but we can implement it there, rather than in generic code
2018-03-21 11:17:36 -04:00
Cole Robinson
538ea96116 guest: devices: change XML ordering to match libvirt 2018-03-21 11:17:36 -04:00
Cole Robinson
b7f6e4990e xmlbuilder: Use OrderedDict for propstore
Let's us drop proporder
2018-03-21 11:17:36 -04:00
Cole Robinson
8d0b1f80f1 cli: Have parser classes reference property names, not xmlbuilders
propertys already give us ways to access the backing class, and
switching to this method lets us drop some infrastructure in
xmlbuilder
2018-03-21 11:17:36 -04:00
Cole Robinson
256f0df8c2 xmlbuilder: Drop s/child_classes/child_class/
The only user was Guest._devices hackery, which has been dropped,
so clean up all this stuff
2018-03-21 11:17:36 -04:00
Cole Robinson
3b88bfb1ee cli: Drop clear_attr property
It slightly complicates the generic machinery, and the one usage we
can handle directly
2018-03-21 11:17:36 -04:00
Cole Robinson
f69b823fad devices: Switch to normal _XML_PROP_ORDER
Drop the register_device stuff, rename virtual_device_type
2018-03-21 11:17:36 -04:00
Cole Robinson
7b61c45d3b guest: Move all_devices to guest.devices.X
The way we enumerate devices doesn't conform with the way all
other XMLBuilder instances expose child objects. Move more towards
that direction.

This requires some virt-xml and cli.py hacks but we will remove those
in future patches
2018-03-21 11:17:36 -04:00
Cole Robinson
fe9ed2340c virtinst: move <domain> XML files to virtinst/domain
And give the classes consistent naming
2018-03-21 11:17:36 -04:00
Cole Robinson
b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson
3909c10441 virtinst: Move all devices to virtinst/devices/ 2018-03-21 07:29:40 -04:00
Cole Robinson
1c911ce567 virtinst: Give device classes consistent DeviceX naming
Previous state was inconsistenty and needlessly wordy. Fix up
a few other class namings that have redundant Virtual in the name
2018-03-21 07:29:40 -04:00
Cole Robinson
93c22eff79 xmlbuilder: Move xml_indent to util 2018-03-20 10:35:22 -04:00
Cole Robinson
3d34f6a231 storage: Fix validating empty hosts value (bz #1557942)
https://bugzilla.redhat.com/show_bug.cgi?id=1557942
2018-03-19 10:29:00 -04:00
Cole Robinson
bf458c2274 kernelupload: Fix it with python3 2018-03-18 11:51:09 -04:00
Cole Robinson
1994b4cf2d devicedisk: fix _is_dir_searchable
And add a test case that would have caught this
2018-03-18 11:51:09 -04:00
Cole Robinson
6969066b9f cli: Don't double print uncaught exceptions with --debug
We have an excepthook that logs uncaught exceptions for good
reason, but if printing --debug to stdout this exception gets
printed twice when we invoke the stock __excepthook__. Skip that
in the debug_stdout case.
2018-03-16 17:56:05 -04:00
Cole Robinson
b25c38816a pylint: Enable 'fixme' checking
Using these for long term TODO type items is not effective, however
it's nice to label things as FIXME during a coding session and have
pylint warn you about them before pushing.
2018-03-15 21:24:48 -04:00
Cole Robinson
6ad6f44920 connection: Call virConnectClose and log the return value
This can help us find object leaks within the code. virConnectClose
is just a deference and will return 1 if other references are still
floating around.
2018-03-15 21:24:48 -04:00
Radostin Stoyanov
8ebab1f27e virtinst: progress: Simplify if-statement
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:24:02 -05:00
Radostin Stoyanov
1ae5c4ff75 pylint: Resolve logging-not-lazy
A new Python checker was added to warn about using a + operator inside
call of logging methods when one of the operands is a literal string.

https://pylint.readthedocs.io/en/latest/whatsnew/1.8.html

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:12 -05:00
Cole Robinson
435fdf2a6a tests: Add xmlns remove_child test case
And tighten up the xmlbuilder xmlns hackery
2018-02-26 14:56:24 -05:00
Cole Robinson
84c02da998 xmlbuilder: Make sure split out XML has xmlns as needed
Otherwise libxml2 whines
2018-02-23 14:41:22 -05:00
Cole Robinson
0624209028 util: Drop libxml2 error callback
If libvirt calls into it, we crash. Fun...

https://www.redhat.com/archives/virt-tools-list/2018-February/msg00029.html
2018-02-23 14:18:55 -05:00
Cole Robinson
3079426c82 virtinst: Drop doc= for properties
This data never gets to the user and largely is just duplicating
libvirt docs. It's redundant
2018-02-22 20:49:07 -05:00
Cole Robinson
6f578ffeff xmlbuilder: Remove get_xml_config prep wrappers
The only user was Guest, and in fact it's not needed for the standard
get_xml_config, only for the custom _get_install_xml. So drop it
2018-02-22 20:49:07 -05:00
Cole Robinson
6cad350649 storage: Use a threading event to signal progress thread
Much more reactive and saves us time in the test suite
2018-02-22 19:12:23 -05:00
Marc-André Lureau
84bc80a900 virtinst/support: add SUPPORT_CONN_VMCOREINFO check
It is supported since qemu 2.11 and libvirt 3.10.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-02-22 16:23:40 -05:00
Marc-André Lureau
0a62ae0b7a virtinst: add <vmcoreinfo/> feature
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-02-22 16:23:40 -05:00
Marc-André Lureau
39721cbe1b connection: support checking for a list of features
Make check_support() accept a list of features.

This will let tests have more complex conditions on the features they
require.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-02-22 16:23:40 -05:00
Cole Robinson
059fb7d0ba xmlbuilder: Order child props before serializing
We were implicitly depending on dict hash ordering here, which
was causing some different XML output in centos CI
2018-02-20 11:41:04 -05:00
Cole Robinson
a8fb49dbe0 xmlapi: Fix some pylint 2018-02-20 11:27:55 -05:00
Cole Robinson
2bea4ecbf6 xmlapi: Some libxml2 simplifications 2018-02-20 11:23:37 -05:00
Cole Robinson
f04b284f21 xmlbuilder: Abstract libxml2 API and cleanup
Moves the libxml2 bits to a separate xmlapi file and class, a bunch
of cleanups to xmlbuilder internals dealing with XML stuff.

The main point is to experiment with different XML library impls,
since libxml2 is unfun to deal with and we are having python3
issues like

https://bugzilla.gnome.org/show_bug.cgi?id=776815
2018-02-20 11:23:37 -05:00
Cole Robinson
a20230091b xmlbuilder: Move xpath string ops to their own class
This streamlines the actual libxml2 interaction quite a bit
2018-02-14 14:49:35 -05:00
Cole Robinson
dce3484e95 xmlbuilder: Move all libxml2 interaction to a single class
Makes the boundaries clearer
2018-02-14 11:29:12 -05:00
Cole Robinson
a853387866 xmlbuilder: Remove more redundant xml state
We don't need to carry around a separate xml_node. Dropping it simplifies
a few things
2018-02-14 11:08:09 -05:00
Cole Robinson
d108bbe143 Convert docstrings to standard reStructuredText param format 2018-02-14 11:08:09 -05:00
Cole Robinson
7cf0b310cc capabilities: Move machine canonicalizing to capsinfo
Rather than overright XML content on every parse
2018-02-14 11:08:09 -05:00
Cole Robinson
c4fdd1d56a xmlbuilder: Remove unused code 2018-02-14 11:08:09 -05:00
Cole Robinson
8917305a6e Don't use count() for substring checking
Use the idiomatic 'X in Y'
2018-02-14 11:08:09 -05:00
Cole Robinson
8e7b5ed2d8 Drop __future__ imports, no longer needed 2018-02-08 14:08:23 -05:00
Cole Robinson
dae8642bb1 xmlbuilder: centralize adding child new child prop instances
Currently the domain CPU class has a child property like:

  siblings = XMLChildProperty(_CPUCellSibling)

If a user wants to add a new sibling, we add a convenience function:

    def add_sibling(self):
        obj = _CPUCellSibling(self.conn)
        self.add_child(obj)
        return obj

Rather than require every child property to define a similar matching
helper function, this adds infrastructure in xmlbuilder to do this
generically for every child property. Now callers can do

    obj = guest.cpu.siblings.add_new()
2018-02-08 14:03:47 -05:00
Cole Robinson
8819176ad4 xmlbuilder: Drop unused node_top_xpath 2018-02-07 15:45:38 -05:00
Cole Robinson
598be36862 xmlbuilder: drop is_build monkey patching
It's not needed
2018-02-07 15:38:30 -05:00