Commit Graph

138 Commits

Author SHA1 Message Date
Cole Robinson
92835f205f connection: Cache x86 cpu values at connection time 2014-09-12 16:28:37 -04:00
Cole Robinson
fb671b4d92 connection: Leave in 'connecting' state until all bits are polled 2014-09-12 16:28:37 -04:00
Cole Robinson
adbe68fc7f connection: Cleanup some initial connection code 2014-09-12 16:28:37 -04:00
Cole Robinson
bd5e57dbdc connection: Simplify state management 2014-09-12 16:28:37 -04:00
Cole Robinson
f0ab054109 connection: Do mediadev setup in a thread
Otherwise a lot of XMLDesc calls are done from the main thread
at connection startup time.
2014-09-12 16:28:37 -04:00
Cole Robinson
9986074ab0 connection: Revive option to show QEMU/KVM in pretty desc
I thought it was unused, but it was just grep fail
2014-07-07 18:00:10 -04:00
Cole Robinson
7fcdd61920 manager: Expand logic to avoid colliding connection descriptions
And drop some unused code
2014-07-04 18:20:54 -04:00
Cole Robinson
aa823b5b58 connection: Handle unsupport KeepAlive (like test URIs) 2014-07-04 18:20:54 -04:00
Cole Robinson
e12d7a6a8c connection: Report error if things fall over during connection bring up 2014-07-04 18:20:54 -04:00
Cole Robinson
f66c4ef3e4 connection: Fix error reporting if TCP creds dialog fails 2014-07-04 18:20:54 -04:00
Giuseppe Scrivano
538c68a41d virt-manager: check if still connected every 20 seconds
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-07-02 15:31:40 +02:00
Cole Robinson
c78974c0d9 connection: Drop netdev abstraction
Just open code it in the one place it's needed. Try to simplify some of
the netlist logic while we are at it. Should fix:

https://bugzilla.redhat.com/show_bug.cgi?id=1109574
2014-06-18 12:41:36 -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
42204c9379 connection: Add debug helper to disable libvirt events 2014-06-02 12:02:09 -04:00
Cole Robinson
519e3b5768 connection: Log when objects are added/removed 2014-05-31 13:52:13 -04:00
Cole Robinson
5c28a00d3e connection: Call path_exists before getting storage volume (bz 1092739)
path_exists will check to ensure the volume actually survives a pool
refresh, incase it was deleted behind libvirt's back. This makes the
delete dialog happier at least.
2014-04-30 16:00:34 -04:00
Cole Robinson
d4c27baa45 connection: Mark a few bits as private 2014-04-16 12:29:24 -04:00
Cole Robinson
873c22d19a connection: Avoid some useless errors when connection closes
- Run the connection
- Restart libvirtd, connection is auto closed
- Re-run the connection
- Manually stop it, see errors in the logs about unknown event IDs

We need to unconditionally clear our event ID list
2014-04-16 12:29:24 -04:00
Cole Robinson
1f7604b241 engine: More work to fix cascading error dialogs
If a remote network connection stalls, the tick queue becomes backed
up while we wait for the hung connection to continue. While this
happens, the queue is filled up with other requests to poll the hung
connection.

When the connection finally times out, the tick thread closes the
connection via an idle callback. However before that callback gets
a chance to run, all the other poll requests for the dead connection
are processed, all launching their own error dialog.

Mark the connection as 'closing' before conn.close is scheduled, and
use it to short circuit the tick() routine.
2014-04-16 12:29:24 -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
adf3545671 connection: Hook into domain balloon event (bz 1081424) 2014-03-31 12:43:49 -04:00
Cole Robinson
565ef4f3ef connection: Make sure a DEFINED event forces a config-change signal
Even if XML didn't change. This is what we do in the non-event case.
Makes it more clear if details->apply triggers a define, but our
change didn't stick for any reason.
2014-03-22 18:14:43 -04:00
Cole Robinson
8562c3258e More pylint fixes 2014-03-22 11:21:19 -04:00
Cole Robinson
081e34715f connection: Handle errors when deregistering events on close (bz 1069351)
Otherwise this interrupts the close/cleanup routine, and the connection
never appears to disconnect in the UI. This causes error dialog spamming
when libvirtd goes down.
2014-03-10 09:35:35 -04:00
Cole Robinson
df7012a68b Handle libvirt generating invalid volume XML (bz 1072770) 2014-03-06 12:04:08 -05:00
Cole Robinson
f67df11701 vmm connection: Handle missing storage volumes (bz 1070883)
Similar to what was done in a808bd6692
for the virtinst connection wrapper.
2014-02-27 13:16:21 -05:00
Cole Robinson
88538f916d connection: Actually fix domain event deregister 2014-02-14 10:00:45 -05:00
Cole Robinson
3f27bc1bd1 connection: Fix race when updating conn.vms
We update the canonical conn.vms list in an idle callback, so any parts
of the main UI thread won't see the conn.vms change while they are
iterating over it.

Problem with this, is that if multiple ticks() are scheduled before
the first idle handler has a chance to run, we can overwrite the VM
list can fail to be correctly updated.

Fix this by only updating 'vms' if it actually changed.
2014-02-13 11:17:14 -05:00
Cole Robinson
7aecd1a9b8 connection: Fix deregisterevent tracebacks on app close 2014-02-11 16:26:15 -05:00
Cole Robinson
e0381cc970 connection: Deregister event callbacks on close 2014-02-11 15:45:04 -05: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
21fb072d4a virt-install: Default to qcow2 for new images
Following along with virt-manager's change. It has all the features and
good enough performace, and is easy enough to override for people that
care.
2014-02-10 18:47:58 -05:00
Cole Robinson
032dd0cf21 clone: Show destination host if on a remote connection (bz 881099) 2014-02-01 18:59:10 -05:00
Cole Robinson
021ffd17e2 domain: Stop using UPDATE_CPU xml flag
Now that feature UI is gone, it doesn't do us any good. And actually
can cause issues if changing from host-model to a static model.
2014-01-31 10:48:45 -05:00
Cole Robinson
0a77093cbc console: Handle ipv6 addresses (bz 974126) 2014-01-29 11:02:54 -05:00
Cole Robinson
58d5e0b799 uihelpers: Move a few more functions closer to their callers 2014-01-26 17:51:15 -05:00
Martin Kletzander
dc0b9bbaaf Rename hide_unsupported_rhel_options to stable_defaults and clean-up its usage
There were multiple problems with the setting and usage of
hide_unsupported_rhel_options.  Due to the fact that the option has
several diferent namings throughout the code, this patch is renaming
it to stable_defaults, which basically says what the option does and
makes it possible to use it without need for more than one negation
(where the old code had up to 4 of them in some places), which also
helps understanding it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-01-21 17:13:18 +01:00
Cole Robinson
7f66926721 Fix first time remote URL installs from virt-manager (bz 1049852)
On first run, the remote URL install handling creates a storage pool
for /var/lib/libvirt/boot on the remote host. After this, it clears
the VirtualConnection's object cache, so the next time all pools are
fetched, it returns an accurate list.

However that clear_cache call wasn't propagated up to virt-manager's
cache. Add a new cb to fix it.
2014-01-18 14:57:39 -05:00
Cole Robinson
eb33bd34e7 Misc improvements to some debug messages 2013-11-09 18:17:29 -05:00
Giuseppe Scrivano
5798c5b9b4 virt-manager: prefer os.makedirs to os.mkdir when creating cache dir
Ensure the parent directories exist when attempting to create the
cache directory.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1016435

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-11-05 18:15:11 +01: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
89646fe841 addhw: Filter root hubs out of USB device list 2013-10-05 14:40:38 -04:00
Cole Robinson
a2cbb9f500 support: s/CONN_HV/CONN/g
We don't need to distinguish these days.
2013-10-02 16:41:23 -04:00
Cole Robinson
9194feb1f5 virt-manager: Default to qcow2 on kvm
qcow2 enables fancy features like snapshots and is generally more
desktopy, which we purport to be.

We only do this on not horribly old libvirt/qemu, and only on qemu
connections. This may work for xen but I'm not going to turn it on
until someone tests it.
2013-10-02 15:34:34 -04:00
Cole Robinson
868fbd9fc9 snapshots: Add screenshot support
Show a screenshot in the 'new snapshot' wizard. If we successfully create
that snapshot, save the screenshot in

~/.cache/virt-manager/$connuri/$vmuuid/snap-screenshot-$snapname.$ext

And show it in the snapshot details overview. We don't do any reaping
on snapshot delete, vm delete, etc, but that could be added later.
2013-10-01 10:14:51 -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
98a95b2e2d network: Add install() command, remove function from vmmConnection
This is the pattern used by other virtinst objects
2013-09-30 15:38:34 -04:00
Cole Robinson
8f0bfb1ad6 host: Allow renaming a storage pool 2013-09-29 12:28:01 -04:00
Cole Robinson
369a17160a host: Allow renaming virtual networks 2013-09-29 12:14:00 -04:00
Cole Robinson
cd7837bc4b domain: Clean up some support checks
We don't need to cache things since virtinst/connection does it for
us.
2013-09-29 09:58:31 -04:00
Cole Robinson
72058f2bbf support: Remove unused nodedev support checks 2013-09-29 09:19:56 -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
14103f175d VirtualConnection: Allow setting a display name for fake URIs 2013-07-23 17:34:32 -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
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
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
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
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
2e47d2e5fa connection: Only overwrite master lists in main thread 2013-07-07 08:44:46 -04:00
Cole Robinson
141ad96298 connection: Remove some dead code 2013-07-06 21:41:27 -04:00
Cole Robinson
76887c9a32 engine: Switch tick threading model to use queues
And allow other parts of the API to request a priority tick that is
dispatched from the main tick thread.
2013-07-06 21:24:38 -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
eb53a6770b vmmConnection: Minor cleanups to libvirt polling 2013-07-06 17:49:42 -04:00
Cole Robinson
125cbc4541 virtManager: connection: Clean up some inconsistent API 2013-07-06 17:24:51 -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
Cole Robinson
ba3aa9ecca Drop conn_max_vcpus validation
Let's just let libvirt throw an error in the rare occasion that we
exceed max vcpus.
2013-07-06 12:40:24 -04:00
Cole Robinson
492a039f7d VirtualConnection: proxy virtinst.support API
Simplifies the lives of callers, and will allow us to do caching later
2013-07-06 12:40:24 -04:00
Cole Robinson
ec734191fc virtinst: connection: Absorb all scattered URI helpers 2013-07-06 12:40:24 -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
255ba11079 virt-manager: Drop remnants of read-only connection support
Haven't supported it for a while
2013-07-05 09:00:31 -04:00
Guannan Ren
32f0781531 addhardware: differentiate duplicate usb devices by bus/addr
When there are multiple usb devices with same vendor/product
in the host device list, the bus/addr is going to be used when
attaching one of usb devices.

Currently is_dup flag is only useful to VirtualHostDeviceUSB.

I put get_nodedevs_number() in connection.py, so the startup
hooks can use it.
2013-05-09 13:48:18 -04:00
Guannan Ren
15f72a84ab check cpu host-model mode support
UPDATE_CPU flag exists after v0.8.0, so libvirt that
supports HOST_MODEL should support UPDATE_CPU,
the earliest version we are going to check is v0.9.10.
2013-04-20 16:04:43 -04:00
Cole Robinson
7e23244096 Port from gconf to gsettings
This unfortunately has a decent amount of fallout: add a wrapper class
in config.py that reduces much of the churn.

Another big piece is that gsettings can't accept arbitrary paths like
gconf would, everything needs to be described in the schema.

Also do a bunch more RPM spec modernizing
2013-04-18 12:43:16 -04:00
Cole Robinson
c60ad16b3b Convert all DBus usage to Gio GDBUS
And drop a whole bunch of legacy dbus fallback stuff. Now that we
are bumping the host dependencies to very recent gtk, none of the
back compat should matter.
2013-04-16 15:22:09 -04:00
Cole Robinson
812899daf8 Remove HAL support
It is long since deprecated, and the UI has been able to accomodate
lack of interface API support for a while.
2013-04-15 19:51:46 -04:00
Cole Robinson
3f79fa3919 Fix the last of the pylint messages
If using an older pylint, there are still some complaints about hashlib
and Popen, but those aren't our problems.
2013-04-13 13:45:08 -04:00
Cole Robinson
ae471007fc Tons of misc pylint fixes 2013-04-13 13:40:29 -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
927bcc11cd virtinst: util: Move URI helpers to their own file
Helps us avoid some relative imports, and makes things cleaner.
2013-04-11 12:15:38 -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