Commit Graph

49 Commits

Author SHA1 Message Date
Cole Robinson
cad809fe80 Make all dialogs clean up when vm/conn disappears
Moves all the window cleanup handling to each class and audit for
all --test-leak-debug errors and fix
2018-03-15 21:24:48 -04:00
Cole Robinson
20d5c1887a baseclass: Export GObject.SignalFlags.RUN_FIRST
Saves some typing and imports
2018-03-15 21:24:48 -04:00
Cole Robinson
62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Tristan Helmich
27703ca379 storage: Enable creation of zfs storave volumes 2016-08-09 11:48:34 -04:00
Cole Robinson
9a67fc4d6e storagepool: Don't double invoke 'refresh' when events are present
We need to tweak refresh() handling to work similar to the shared
XML and status caching in libvirtobject.py: when the user manually
invokes the refresh() operation, and storage events are set up,
we just invoke the refresh() but let the event loop handle
refreshing the cache.

This fixes a backtrace when invoking a manual refresh via the
host details dialog
2016-06-23 15:38:31 -04:00
Cole Robinson
6d587c40bb storagepool: Don't refresh newly arriving pools
If they show up while a connection is 'active', it means they were
just defined/created, and thus a pool refresh is likely redundant
2016-06-20 17:21:46 -04:00
Jovanka Gulicoska
b904d62e47 Use storage pool lifecycle events
API will be available in upcoming libvirt 2.0.0
2016-06-18 11:08:14 -04:00
Cole Robinson
0bf6124a28 storage: Fix updating UI when volume deleted (bz 1279940)
We in fact weren't updating the cached XML when pool.refresh() was called.
2015-11-10 17:40:04 -05:00
Cole Robinson
87098d1273 storagepool: Refresh volumes on state change
Otherwise the UI list is out of date
2015-04-10 18:17:29 -04:00
Cole Robinson
42648f45f0 libvirtobject: Clean up XML invalidation
Make sure we aren't invalidating things when we are using events. Don't
overload APIs so much.
2015-04-10 17:50:06 -04:00
Cole Robinson
d0ffd954cd connection: Unify initial object refresh handling
Have libvirtobjects advertise a routine specifically for initial setup,
and emit a signal when it's complete. Then dispatch the associated conn
signal on demand as the objects are initialized. This should avoid a
whole class of ordering issues, and is easier to follow IMO.
2015-04-10 15:00:42 -04:00
Cole Robinson
838baf6946 connection: tick: Operate on combined object lists
Makes the flow a bit simpler, and allows us to break out polling without
having to pass around a ton of lists.
2015-04-10 15:00:34 -04:00
Cole Robinson
cb5d075f50 libvirtobject: Unify a few APIs and conn tick handling 2015-04-10 15:00:34 -04:00
Cole Robinson
1e154a373d libvirtobject: Populate status up front
And use this to kill paranoid object tick() that are sprinkled throughout
the code.
2015-04-10 15:00:34 -04:00
Cole Robinson
4933cf7600 libvirtobject: Clarify force_update_status 2015-04-10 15:00:34 -04:00
Cole Robinson
c9b882619e libvirtobject: Add decorator for lifecycle events
That does the appropriate event loop updating, if needed.
2015-04-10 15:00:34 -04:00
Cole Robinson
a3f8d73a9c libvirtobject: Unify internal status APIs and signals
Drop config-changes vs. status-changed and just use one signal, since they
are largely the same code paths for all users.
2015-04-10 15:00:34 -04:00
Cole Robinson
01bf07ba11 libvirtobject: Unify status signals
Dispatch them all from the actual object and not proxied through
the connection. Use the same signal name for all objects with the same
signature.
2015-04-10 15:00:33 -04:00
Cole Robinson
fb7a921ec4 storagelist: Select newly created pool/volumes
And clean up some of the internal APIs in this area
2015-04-10 15:00:33 -04:00
Cole Robinson
38738d9fa6 connection: Don't close VM dialog on rename
Rework things a bit to simplify everything we pass around.

The specific bug fix is making sure we update the object list in place,
otherwise the event loop detects it as the VM being deleted and closes
the details window.
2014-09-20 17:32:09 -04:00
Cole Robinson
226c4562d5 virtManager: Switch to relative imports 2014-09-12 16:28:38 -04:00
Cole Robinson
3753fcbaa3 addstorage: Rate limit the default pool refresh 2014-09-12 16:28:37 -04:00
Cole Robinson
76bc8e5ab9 connection: Do initial object refreshes in a thread
None of these objects are urgent, and this allows us to split up the
initial API calls to be more parallel.
2014-09-12 16:28:37 -04:00
Cole Robinson
d1c22b3b2c storagepool: Don't default to refreshing volume list
This needlessly hits the network too much. The places where it's
important to have up to date info will either manually call pool
refresh, or give the user an refresh button.
2014-09-12 16:28:37 -04:00
Cole Robinson
8d862a7b7b storagepool: Don't defer initial refresh to main thread
Otherwise this can block the UI on initial connect
2014-09-12 16:28:37 -04:00
Cole Robinson
aefd4c4824 connection: Use name instead of uuid for object keys
And clean up the API mess while we are at it. Treat the key as an opaque
value that users shouldn't depend on.

Besides the improved code clarity and API layout, this will help diagnose
'key error' issues, since we'll see an object name instead of UUID which
is hard to trace back.
2014-06-02 17:48:32 -04:00
Cole Robinson
51976bba2d storagevol: Log on XMLDesc errors 2014-05-19 17:32:22 -04: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
2a25c8d37d host: Print iscsi volume key as well in volume list
Suggested here: http://www.redhat.com/archives/virt-tools-list/2013-December/msg00014.html
2013-12-05 09:17:29 -05:00
Giuseppe Scrivano
0df75c7603 headers: update "Red Hat, Inc." copyright for the year 2013
Ensure that any file touched by a @redhat.com author in 2013 has an
updated copyright header.

The files were updated using the build-aux/update-copyright gnulib
script and manually added where the copyright line wasn't present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:26 +01:00
Cole Robinson
56b9f6187b Streamline support checks
Just use one function check_support
2013-10-06 10:08:04 -04:00
Cole Robinson
707a00c950 storagepool: Fix rename 2013-09-30 19:55:21 -04:00
Cole Robinson
844a567e7b details: Don't silently drop managed save when renaming VM
Instead just error about it. Until there's an actual libvirt 'rename'
API we can't do much better than that.
2013-09-30 15:38:35 -04:00
Cole Robinson
8f0bfb1ad6 host: Allow renaming a storage pool 2013-09-29 12:28:01 -04:00
Cole Robinson
52e4976462 pollhelpers: Add fetch_volumes helper
That does the listAllVolumes support check to speed us up a bit.
2013-09-29 09:33:17 -04:00
Cole Robinson
a9a085340b support: Rename SUPPORT_STORAGE to SUPPORT_POOL
It's more accurate. And fix up comments about back compat which no
longer apply.
2013-09-29 09:21:42 -04:00
Cole Robinson
7a5dc7c544 devicedisk: path_in_use_by: Check backing stores as well
Plumb through a fetch_all_vols helper for this, and do all the
caching bits.
2013-09-28 21:07:18 -04:00
Cole Robinson
a7b1414dc5 libvirtobject: Make parseclass non-optional
All libvirtobject child classes have an associated XMLBuilder now, so
make it mandatory.
2013-09-23 08:34:50 -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
7c55cfeb39 virtManager: Drop util, combine it with virtinst.util and uihelpers 2013-08-11 12:39:28 -04:00
Cole Robinson
0d5fe93048 Centralize XML helpers in virtinst/util.py 2013-07-12 13:10:23 -04:00
Cole Robinson
5e9e444dec connection: Do non-VM polling on demand
The goal here is to reduce the amount of tick() polling that we do by default.
For things like pools, networks, and interfaces, the constant polling is
not very helpful and causes CPU churn and slowness for remote connections.

Switch to a more on demand style. Pages that want new information for
these objects now request a priority tick that only refreshes the info
we want.

This isn't perfect, but neither was the previous solution in the face of
things like XML updates behind our back. The real solution here is libvirt
event support across the board.
2013-07-07 12:17:54 -04:00
Cole Robinson
b044dd94c7 Various cleanup and sync between libvirtobject classes 2013-07-07 09:05:01 -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
ead31139b0 virtManager: Emit state change signals from objects
This is a step towards supporting listAll*() API and domain events.

We still proxy these signals through vmmConnection so that we don't
need to rework the dependent code yet.
2013-07-06 20:09:18 -04:00
Cole Robinson
be2d9ddcb4 Add base conn object and bump minimum libvirt version to 0.6.0
This base connection object will be used to simplify the API in various
places, reduce libvirt API calls, and better share code between virtinst
and virt-manager. For now it just centralizes connection opening.

This also exposed various places where our handling for older libvirt
was busted, so raise our minimum host version to 0.6.0, the first
version that supports threaded client requests.
2013-07-05 16:42:19 -04:00
Cole Robinson
0d243983d0 Revive pep8 and clean up the code
autopep8 is pretty cool :)
2013-04-13 15:22:43 -04:00
Cole Robinson
9515a8575d Disable pylint warnings about gi.repository
Since pylint still can't handle the dynamic nature of gobject
introspection.
2013-04-12 08:27:45 -04:00
Cole Robinson
9d05583c26 Remove autotools, replace with distutils-extra
Despite being a known quantity, autotools is so overkill for our needs,
so let's drop it and replace it with a much simpler and easy to customize
system.
2013-04-03 18:20:51 -04:00