Commit Graph

252 Commits

Author SHA1 Message Date
Cole Robinson
36c669d45a Replace get_property("sensitive") with get_sensitive 2013-09-09 11:02:34 -04:00
Cole Robinson
b6c078ad75 addhw: disk cache default should be 'default' not 'none' 2013-09-09 10:50:56 -04:00
Cole Robinson
6869760732 asyncjob: Fix issues with multiple dialogs (bz 1003101)
Basically, drop usage of nested main loops. As has been documented in
other commit messages, we use nested main loops in ways they aren't
supposed to be used. They gave us async behavior that would block
callers, but had weird behavior in some edge cases.

Switch to having async dialogs be 100% async, requiring the user to
pass in a completion callback which is triggered after the async
action is complete.
2013-09-06 21:30:19 -04:00
Cole Robinson
0551d8956b error: Rename confusing sync/async param to modal 2013-09-06 20:16:37 -04:00
Cole Robinson
aabb3c8e48 asyncjob: Remove unused async parameter 2013-09-06 20:16:25 -04:00
Cole Robinson
0eab1706cc console: Fix password screen issue
Connect to remote URI, connect to VNC guest with password auth. Don't
enter password, just close the details window. Reopen the window,
password UI is still there, but it's no longer hooked up behind the
scenes. Fix it.
2013-09-06 19:55:46 -04:00
Cole Robinson
5bf63759b6 console: Fix issues with spice and askpass (bz 811346)
Spice opens many FDs to handle different channels (display, usb, sound,
etc.). For remote SSH URIs, this means we launch multiple SSH proceses.
We do so by forking off the process, and when SSH has successfully
authenticated, the data starts flowing.

If using spice + remote SSH w/o SSH keys, you need to put your data
into ssh askpass. askpass wants to own the display for security reasons.

When all the channel requests start coming in, we were launching multiple
ssh processes one after another. This upset askpass and generally
caused havoc in the app.

Add some infrastructure to serialize launching ssh processes. We only
launch the next ssh process if spice/vnc have conclusively connected
or errored out the connection. This makes connection a bit slower
for the non-askpass ssh case (about 1.5 seconds), but will ignore
avoid this oft reported problem.
2013-09-06 19:36:09 -04:00
Cole Robinson
4910611d3c autodrawer: Drop note about broken child_get_property
I can't reproduce anymore
2013-09-02 12:02:33 -04:00
Cole Robinson
efbc815a60 addhardware: Modernize 'graphics' UI
- Drop SDL, it doesn't mesh with modern libvirt
- Drop keymap, modern qemu/virt-manager handle this automagically
- Drop big text fields
- Misc other cleanups and simplifications
2013-09-02 11:59:02 -04:00
Cole Robinson
b86c5b21ec manager: Use consistent row spacing even if we disable all graphs 2013-09-02 10:43:53 -04:00
Cole Robinson
bbf51ee3cb baseclass: Build error object on demand
Should speed things up a tiny bit in the common case
2013-09-02 09:35:07 -04:00
Cole Robinson
f141c77c45 manager: Separate stats and state update callbacks
There's no need to be resetting row keys like VM name, state, on every
'resources-sampled' signals, since we have had finer grained status-changed
and config-changed signals for a while. This seems to reduce the memory
leak on F19 as well.
2013-09-02 09:32:50 -04:00
Cole Robinson
db7db9ab47 manager: Disable graph data func if graph isn't visible
Seems like pygobject is a bit leaky with tree row accesses, and
the cell cb hammers on that quite a bit, even if the graph isn't showing.
2013-09-02 08:42:25 -04:00
Cole Robinson
9c5962c72a graphwidgets: Make a division check more robust
Not an issue in practice, but I was stubbing out some parts of the code
in trying to track down a memory leak and this check failed.
2013-09-02 08:42:25 -04:00
Cole Robinson
9d87b0d342 Replace set_property("visible") with modern set_visible 2013-09-01 20:18:14 -04:00
Cole Robinson
1ce02cc7d9 addhw: Fix FS UI for non-qemu 2013-09-01 20:07:46 -04:00
Cole Robinson
ae7ebc220b details: Properly limit machine type list by guests arch/type 2013-09-01 19:21:21 -04:00
Cole Robinson
1bd6026515 manager: Merge some row creation, drop unneeded row keys 2013-09-01 18:36:58 -04:00
Cole Robinson
10161a8fdb details: Track serial pages as console tabs
A bit cleaner conceptually, and shrinks the ever growing details.py
2013-09-01 17:40:38 -04:00
Cole Robinson
cdc82e62a2 console: Fix spice with TLS (bz #904295)
We now use the same CA trust store as virt-viewer's default, which is:

~/.spicec/spice_truststore.pem
2013-09-01 16:09:35 -04:00
Cole Robinson
280663c685 packageutils: Don't implement our own search dialog (bz #746011)
Our search dialog isn't as full featured as packagekits, so just call
out to that. This was originally avoided because it doesn't full
provide the semantics we want, but it's close enough and saves us
from duplicating all their work.
2013-09-01 14:19:23 -04:00
Cole Robinson
82ef6ba173 console: Catch spice connection errors (bz #971558) 2013-09-01 13:25:37 -04:00
Cole Robinson
2c918ecaa6 uihelpers: Don't list 'lo' as a macvtap interface (bz #980606) 2013-08-31 13:14:47 -04:00
Giuseppe Scrivano
f238abfe4d virt-manager: ignore another VIR_ERR_NO_DOMAIN error
It fixes this exception while removing a VM:

Traceback (most recent call last):
  File "virt-manager/virtManager/details.py", line 1438, in refresh_vm_state
    self.change_run_text(vm.hasSavedImage())
  File "virt-manager/virtManager/domain.py", line 1238, in hasSavedImage
    return self._backend.hasManagedSaveImage(0)
  File "/usr/local/lib/python2.7/site-packages/libvirt.py", line 852, in hasManagedSaveImage
    if ret == -1: raise libvirtError ('virDomainHasManagedSaveImage() failed', dom=self)
libvirt.libvirtError: Domain not found: no domain with matching uuid
  '7c3eebec-9b22-48ea-b9a2-3341840d0476' (test)

Traceback (most recent call last):
  File "virt-manager/virtManager/manager.py", line 885, in vm_status_changed
    self.vm_selected()
  File "virt-manager/virtManager/manager.py", line 1009, in vm_selected
    self.change_run_text(vm.hasSavedImage())
  File "virt-manager/virtManager/domain.py", line 1238, in hasSavedImage
    return self._backend.hasManagedSaveImage(0)
  File "/usr/local/lib/python2.7/site-packages/libvirt.py", line 852, in hasManagedSaveImage
    if ret == -1: raise libvirtError ('virDomainHasManagedSaveImage() failed', dom=self)
libvirt.libvirtError: Domain not found: no domain with matching uuid
   '7c3eebec-9b22-48ea-b9a2-3341840d0476' (test)

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-08-27 13:44:43 -04:00
Martin Kletzander
3f47140cf9 uihelpers: Fix storage unit
We use GB everywhere, but there was one place missing where we used Gb
instead.
2013-08-27 07:33:28 +02:00
Cole Robinson
948b5359d2 virt-manager: Hide snapshot work behind --experimental-snapshot-ui
I don't want to publicize the UI and the current feature set until
we are sure it's what we want to support, so hide it for now.
2013-08-21 18:47:05 -04:00
Cole Robinson
e8531b1f40 Initial snapshot support
This adds initial UI for managing snapshots: list, run/revert, delete,
add, and redefining (for changing <description>) supported, but currently
only for internal snapshots. The UI is mostly in its final form except for
some bells and whistles.

The real remaining question is what do we want to advertise and support.
Internal (qcow2) snapshots are by far the simplest to manage, very
mature, and already have the semantics we want.

However most recent libvirt and qemu work has been to facilitate
external snapshots, which are more extensible and can be performed
live, and with qemu-ga coordination for extra safety. However
they make things much harder for virt-manager at the moment.

Until we have a plan, this work should be considered experimental
and not be relied upon.
2013-08-21 18:41:42 -04:00
Martin Kletzander
3b9c397d11 Handle storage formats properly
This simple patch fixes three issues:

 1) We used only one list of storage formats.  However, we are able to
    use some formats which we cannot create.  This patch adds a list
    called 'no_create_formats' and moves such formats (currently only
    one) into it and uses new parameter 'create' which describes
    whether such formats should be removed or not.

 2) When creating new storage with the above fixed, we need to set the
    combobox's text to "" in order not to change it to "raw".  This
    was already done in reset_state(), but we need it also when
    toggle_storage_select() happens and it doesn't hurt in
    set_initial_state(), so I abstracted the implementation into
    populate_disk_format_combo().

 3) It's a bit unrelated, but when bus of a domain disk gets changed
    (in details.py), the address was not cleaned up properly ('target'
    attribute was still kept), so I fixed up the VirtualDeviceAddress
    as well.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=907289
2013-08-21 11:12:42 +02:00
Cole Robinson
1ce5fb1bb9 details: Wire up DTB support
Only show it for supported archs (arm, microblaze, ppc). Take this
opportunity to tweak the kernel/initrd UI a bit
2013-08-18 12:42:07 -04:00
Cole Robinson
7edd2c5208 Fix spelling error in function names 2013-08-18 12:30:58 -04:00
Cole Robinson
e52f6050fa qemu ARM support: wire up virtio, fix a bunch of defaults
This has some fallout on non-x86 tests which were wrong to begin with.
There's still some missing bits but this is the jist of it.
2013-08-18 12:30:58 -04:00
Cole Robinson
414f6bbd99 guest: Use virtio on plain qemu on x86
It's been available for a long long time, and unifies code paths.
2013-08-17 18:00:31 -04:00
Cole Robinson
a8858cd366 osdict: Don't run support checks, make the caller do it
Some ARM bits we are about to add would substantially complicate the
current setup, so move all the logic into guest.py where we can be
more flexible. I think this is closer to what libosinfo will give us
as well.
2013-08-17 17:53:17 -04:00
Giuseppe Scrivano
c1fa43ebb9 virt-manager: ignore VIR_ERR_NO_DOMAIN when a domain was just deleted
Some callbacks could try to access a domain that was just deleted and
not accessible anymore.  Detect these cases and don't propagate the
exception.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-08-16 11:51:15 -04:00
Giuseppe Scrivano
da3237e8a6 virt-manager: automatically select newly created volume
When a new volume is created for a storage, automatically select it;
most likely it is what the user will choose to use.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

(crobinso: util is gone now, replace with uihelpers)
2013-08-14 20:42:27 -04:00
Giuseppe Scrivano
155a7f1f03 virt-manager: fix "Copy Volume Path" in storage pool details window
It fixes this error:

Traceback (most recent call last):
  File "virt-manager/virtManager/host.py", line 973, in copy_vol_path
    clipboard.set_text(target_path)
  File "/usr/lib/python2.7/site-packages/gi/types.py", line 113, in function
    return info.invoke(*args, **kwargs)
TypeError: set_text() takes exactly 3 arguments (2 given)

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-08-14 20:42:27 -04:00
Giuseppe Scrivano
f4918b3b32 virt-manager: prevent events while the storage pool model is accessed
It fixes this error:

Traceback (most recent call last):
  File "virt-manager/virtManager/storagebrowse.py", line 271, in pool_selected
    pool = self.current_pool()
  File "virt-manager/virtManager/storagebrowse.py", line 238, in current_pool
    return self.conn.get_pool(row[0])
  File "virt-manager/virtManager/connection.py", line 645, in get_pool
    return self.pools[uuid]
KeyError: 'bd9fd5ec-a35c-d84a-b9b2-2aca98f733c3'

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-08-14 20:42:27 -04:00
Giuseppe Scrivano
b3457b9d35 virt-manager: vmmCreateVolume uses the correct connection
Set the connection used by vmmCreateVolume everytime the window is made
visible.  This fixes a case where volumes could be added to the wrong
pool if the same vmmCreateVolume window was already used on a different
connection.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-08-14 20:42:27 -04:00
Giuseppe Scrivano
a8dbebd4ba virt-manager: fix refreshing storage pool browse list
The commit b044dd renamed vmmStoragePool.uuid to vmmStoragePool._uuid,
causing this error:

Traceback (most recent call last):
  File "virtManager/storagebrowse.py", line 280, in refresh_current_pool
    self.refresh_storage_pool(None, cp.get_uuid())
  File "virtManager/storagebrowse.py", line 243, in refresh_storage_pool
    if curpool.uuid != uuid:
AttributeError: 'vmmStoragePool' object has no attribute 'uuid'

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-08-14 20:42:07 -04:00
Cole Robinson
5ec2d0cb8e details: Also clear serial list in cleanup() 2013-08-14 20:10:42 -04:00
Giuseppe Scrivano
2751a134f2 virt-manager: do not delete tabs while destroying the details window
_close_serial_tab triggers the switch-page event and that can provoke a
refresh of the window.  This causes an error everytime the details window
is pointing to a domain that was just deleted.

Solves: https://bugzilla.redhat.com/show_bug.cgi?id=985291

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-08-14 20:04:49 -04:00
Cole Robinson
f220e6778c Guest: Drop OS listing helpers, and OS_TYPES back compat 2013-08-11 14:52:30 -04:00
Cole Robinson
c426d5a16f Guest: Drop os_type, just use single os_variant
Internally the distinction hasn't been valuable for a long time,
so simplify the API here.
2013-08-11 12:39:36 -04:00
Cole Robinson
3e158b80bf guest: Move cpuset static functions to DomainNumatune 2013-08-11 12:39:28 -04:00
Cole Robinson
87789548ba guest: Drop consolecb and wait parameters from start_install 2013-08-11 12:39:28 -04:00
Cole Robinson
7c55cfeb39 virtManager: Drop util, combine it with virtinst.util and uihelpers 2013-08-11 12:39:28 -04:00
Giuseppe Scrivano
ff57d636d7 Drop user back to 'open conn' dialog if connecting fails
In case of connection failure, the user can either maintain the connection
or modify it.

Split up `add_connection_to_ui' into `make_conn' and `register_conn'
to handle separately the object creation and its registration in the
list of connections (ui and conf).

Solves: https://bugzilla.redhat.com/show_bug.cgi?id=617386
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-08-08 14:38:31 -04:00
Cole Robinson
7664840e68 createnet: Refresh forward device list when wizard is launched 2013-08-05 17:20:05 -04:00
Giuseppe Scrivano
2a67ec9ed6 ui: allow to set an empty password for graphics
Now when a password is used a check box must be explicitely selected.
This enable the possibility to set an empty password "".

Solves: https://bugzilla.redhat.com/show_bug.cgi?id=749718

Signed-off-by: Giuseppe Scrivano <gscrivano@gnu.org>

(crobinso: fix minor pylint violation)
2013-08-01 11:42:08 -04:00
Marc Deslauriers
b9cb73ec47 Switch AppIndicator code to use GObject introspection. 2013-07-29 14:45:06 -04:00