Commit Graph

5603 Commits

Author SHA1 Message Date
Cole Robinson
f088537798 engine: break out vmmConnectionManager
Have a separate class for tracking the connection list, and emitting
conn-added and conn-removed signals. It exists as a singleton instance
that UI classes can talk directly to
2018-03-15 21:24:48 -04:00
Cole Robinson
befafe9dc7 engine: connect conn-added in UI classes
This creates a weird situation where we pass the engine to those
classes UI functions, but this is a step towards untangling that.

While here, get rid of the conn-added connect magic and add a
simpler way to access the connection list from the engine
2018-03-15 21:24:48 -04:00
Cole Robinson
2dcfaafcac inspection: Show inspection error in details page 2018-03-15 21:24:48 -04:00
Cole Robinson
c21e0db6ea inspection: Remove startup delay
Like the comment says it shouldn't matter
2018-03-15 21:24:48 -04:00
Cole Robinson
48e97e85a6 inspection: Skip for test connections 2018-03-15 21:24:48 -04:00
Cole Robinson
6b1278ccda prefs: Add a setting to enable/disable libguestfs inspection
Rather than key it on the library being available. Makes it much
easier to test both modes of behavior.

Fix up a few inspection bugs while I'm in the area, and convert
it to be more singleton like.
2018-03-15 21:24:48 -04:00
Cole Robinson
6959a41ff2 connection: Drop vm-added emission on connect
We don't use this for most other signals and it's kind of unexpected
2018-03-15 21:24:48 -04:00
Cole Robinson
3187078f10 config: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson
33def3c4af preferences: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson
b6a61818af about: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson
717ff72684 engine: Move VM action callbacks to vmmenu.py
Call the callbacks directly rather than using signals. engine.py
has become a bit of a catchall for shared functionality and this
is a step towards disentangling it
2018-03-15 21:24:48 -04:00
Cole Robinson
42e4cc33bf systray: Fix VM leak on conn close 2018-03-15 21:24:48 -04:00
Cole Robinson
fbf1bc80b5 connection: Dispatch object remove signals on close 2018-03-15 21:24:48 -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
Cole Robinson
7e1cddef18 virt-manager: Add hidden --test-leak-debug option
That enables the pre-existing debug_ref_leaks behavior
2018-03-15 21:24:48 -04:00
Cole Robinson
b3c69a05a2 connection: Fix connecting to conn with no objects
Our thread handling leaves us permanently in the 'connecting' state
2018-03-15 21:24:48 -04:00
Cole Robinson
c6c24c59ac connection: Remove unused argument 2018-03-15 21:24:48 -04:00
Cole Robinson
eb5cd8b2c9 host: Drop vestiges of old VM restore support
This hasn't been in the UI for a long time
2018-03-15 21:24:48 -04:00
Cole Robinson
56cf42e6ea engine: Only init systray if launching new app
We were doing it too early, and the systray could pop up for a moment
when connecting to a remote app
2018-03-15 21:24:48 -04:00
Cole Robinson
cfe633f964 systray: Drop appindicator support
Does anyone care about this anymore? Unity is gone, if the libs are
present on a gnome install it's always been funky (currently doesn't
display an icon on f27), libappindator seems largely dead upstream,
and traditional systray icons give very similar behavior.

Kill it and see if anyone complains
2018-03-15 21:24:48 -04:00
Nicolas Bock
27d4b167d5 Update --location for OpenSUSE
OpenSUSE is currently at Leap 42.3. This change updates the man page
for virt-install to point to the current repository.
2018-03-07 09:27:38 +01: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
a52c282ed3 pycodestyle: Use module instead of executable
The `pycodestyle-3` executable is provided by the
`python3-pycodestyle` rpm package.
On Debian the corresponding executable is called `pycodestyle3`.
Arch Linux uses Python 3 by default and `python2-pycodestyle`
package is used for the py2 version.

To get around this inconsistency, import the `pycodestyle` module and
call the corresponding methods. The implementation has similar
behaviour to what happens when `pycodestyle` [1] is executed from the
command-line.

[1] https://github.com/PyCQA/pycodestyle/blob/master/pycodestyle.py

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:18 -05:00
Radostin Stoyanov
b8b997fc3a pylint: Resolve consider-using-enumerate
Use enumerate instead of iterating with range and len.
This pylint message is emitted when code that iterates with range and
len is encountered. Such code can be simplified by using the enumerate
built-in. [1]

In addition, remove some unused variables to avoid warnings
`unused-argument` and `redefined-variable-type`.

[1] https://pylint.readthedocs.io/en/latest/technical_reference/features.html#id23

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:14 -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
Radostin Stoyanov
474f60fc56 pylint: Silence inconsistent-return-statements
A new Python checker was added to warn about "inconsistent return
statements" [1]. A function or a method has inconsistent return
statements if it returns both explicit and implicit values.

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

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:08 -05:00
Radostin Stoyanov
4f7bc4f4e6 pylint: Use pylint.lint module
The `pylint-3` executable is provided by the python3-pylint rpm
package on Fedora.
For Debian the equivalent is `pylint3`.
On Arch Linux the default version of Python is 3.

Pylint lints for the version of Python it is running. Instead of
spawning an executable, import the `pylint.lint` module and call
`Run()`.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 15:59:05 -05:00
Cole Robinson
5ac2fe7fe4 libvirtenummap: Absorb similar functionality from domain.py
For mapping state enums to string names and other similar bits
2018-02-27 12:31:56 -05:00
Cole Robinson
1d8cd69f82 connection: Map event vals to libvirt enum names in debug output
Shove this logic into its own class LibvirtEnumMap in its own file,
since this may grow over time.
2018-02-27 12:31:56 -05:00
Cole Robinson
da0d0600da connection: Show event name in debug output for xml misc events 2018-02-27 11:59:15 -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
a58f458fb3 tests: storage: destroy/undefine created objects
Otherwise we pollute the test driver which causes collisions on
libvirt.git
2018-02-23 11:57:57 -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
e70eb82db1 virt-install: Remove redundant isActive check 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
472a52b170 virtconv: Drop all the chdir hackery
This was just lazy stuff to avoid having to assumble abspaths. Plus
it confuses cprofile
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
Cole Robinson
8c3388697c virt-xml: Remove redundant XML roundtripping
Based on how we do diff reporting it doesn't accomplish anything anyways
2018-02-22 18:48:31 -05:00
Cole Robinson
8371a681b1 tests: Remove some redundant clitests
- Consolidate tests if they don't add coverage
- Remove some categories that aren't really required
2018-02-22 18:26:50 -05:00
Marc-André Lureau
55fa6c4caa tests: add xmlparse/change vmcoreinfo test
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-02-22 16:23:40 -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
6954c6774a tests: Fix running testsuite on older libvirt
If we try to run the testsuite on anything older than libvirt 3.1,
it immediately throws an exception before processing any tests,
due to choking on parsing drm bits from testdriver.xml. This global
failure is only due to sloppy coding though.

Turn all test cases that use testdriver.xml into skips in this case,
so we can at least get some test coverage otherwise.
2018-02-22 16:01:24 -05:00
Cole Robinson
62fecb09d3 tests: Create a smaller testsuite.xml
Right now, most test cases will create a libvirt test driver using
tests/testdriver.xml. This is problematic for 2 reasons:

1) testdriver.xml is 3500 lines of XML, and it's parsed hundreds of
   times. Opening it is responsible for about 25% of test suite time
2) Older libvirt chokes on testdriver.xml, meaning the test suite will
   be useless there. This is a recurring problem as new features are
   added to testdriver.xml

Most test cases don't actually need all the test state in testdriver.xml
though. So this creates a smaller testsuite.xml which has a lower
libvirt requirement and is much quicker to parse. New XML bits should
continue to go into testdriver.xml so we can keep testsuite.xml as
the more stripped down option.
2018-02-22 15:44:06 -05:00
Cole Robinson
47afa912b3 setup: tests: Add --testverbose option
Can't use --verbose because it conflicts with setuptools options
2018-02-22 15:18:47 -05:00
Cole Robinson
c05cd52772 setup: Use CLIState for setting --debug value 2018-02-22 15:18:47 -05:00