Commit Graph

44 Commits

Author SHA1 Message Date
Cole Robinson
05db555145 libvirtobject: Don't raise error during init_libvirt_state
The connection doesn't handle it. If it ever needs to know we can have
it return a value or something.
2015-04-24 15:34:55 -04:00
Cole Robinson
fb26349546 domain: Make the tick() logic easier to follow 2015-04-21 17:15:58 -04:00
Cole Robinson
6dbe19bd83 libvirtobject: Fix deleting a running VM
The recent XML rework wasn't catching when a domain disappears while
trying to refresh it's state from the event loop.
2015-04-13 18:24:46 -04:00
Cole Robinson
e9495110ca connection: Refresh XML for every libvirt object event
We tried to split up status vs XML refreshing, but they are tied together
in various ways (like the runtime XML changes when a VM starts). This
was breaking console connecting when starting a VM
2015-04-11 17:24:30 -04:00
Cole Robinson
a0075beab4 libvirtobject: Minor tweaks to ensure we cache domain bits correctly 2015-04-10 18:03:56 -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
a7a19b2abc libvirtobject: Drop redefine_cached
There's no external callers anymore, and the prospect of keeping this
stuff cached but potentially having a thread invalidate it makes me nervous,
so simplify things by making callers explicitly request the object they
want to redefine.
2015-04-10 17:23:11 -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
1c63c2b0d9 libvirtobject: Invalidate cache if redefine fails 2015-04-09 13:01:38 -04:00
Cole Robinson
be5c2c742c libvirtobject: Clean up the internal XML APIs
There was lots of redundancy and confusing semantics. Document functions,
drop a bunch of unneeded ones.
2015-04-07 17:41:29 -04:00
Cole Robinson
c66bc2a87f connection: Have get_nodedevs return vmmNodeDevice
To make it consistent with similar vmmConnection functionas
2015-04-07 14:12:00 -04:00
Cole Robinson
0717a21f65 host: Fix renaming network/storage pool 2014-09-20 17:32:09 -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
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
519e3b5768 connection: Log when objects are added/removed 2014-05-31 13:52:13 -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
4442f1f9be Use network lifecycle events if available
This just allows us to be more reactive to network lifecycle changes.
2014-02-11 15:45:04 -05:00
Cole Robinson
c7cd6ca2d3 Use libvirt events for domain lifecycle tracking (bz 836703)
When events were successfully registered, we skip the VM listing on
every tick, and instead trigger a manual refresh whenever a VM event
is received. Not as efficient as it should be, but saves us a lot of
API calls.
2014-02-11 15:45:04 -05:00
Cole Robinson
58d5e0b799 uihelpers: Move a few more functions closer to their callers 2014-01-26 17:51:15 -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
bdaa0e511a Log object name with XML diff on redefine 2013-10-01 10:21:44 -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
b9bcc84d35 libvirtobject: Remove no longer needed sanitize_xml helper 2013-09-30 15:38:34 -04:00
Cole Robinson
2b74c46909 snapshots: Pretty up the 'new snapshot' dialog 2013-09-30 15:38:12 -04:00
Cole Robinson
369a17160a host: Allow renaming virtual networks 2013-09-29 12:14:00 -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
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
149e19da64 connection: Pass nostatsupdate through to VM tick
When kicking off a priority tick, we want to update domain status but not
update stats listing.
2013-07-07 09:42:21 -04:00
Cole Robinson
b044dd94c7 Various cleanup and sync between libvirtobject classes 2013-07-07 09:05:01 -04:00
Cole Robinson
ed5e67485c domain: Don't pass timestamp to domain tick()
Since we might not poll stats info until a decent amount of time after
this timestamp, it messes up VM stats reporting.

Our usage still isn't correct because we use a later timestamp for
calculating total host usage. We could fix it by averaging out the
timestamp of each VM but I don't care that much at the moment.
2013-07-07 08:44:46 -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
80e6389b75 Fix a spelling error 2013-06-30 14:33:01 -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