summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* man: Improve doc for 'ca' in .vv filesChristophe Fergeau2014-10-091-1/+2
| | | | | Make it clearer that this CA will be used to validate the certificate presented by the remote SPICE host when using TLS.
* Fix 'seperate' typo in man page/commentsChristophe Fergeau2014-10-092-5/+5
|
* ovirt: Allow to remove CD imagesChristophe Fergeau2014-10-092-5/+1
| | | | | | | | | | | | | It turns out this is supposed to be done through update requests with a CD image with an empty name, which is what the current code tries to do. The only reason it's not working is because of server-side bugs with oVirt < 3.5 The requirement on libgovirt is raised to 0.3.2 as a small change is needed as well in libgovirt to allow empty filenames: https://git.gnome.org/browse/libgovirt/commit/?id=bdb788fcc Without this change, nothing too bad will happen, but the CD won't be removed and warnings will be logged in the console.
* Prefer virDomainOpenGraphicsFD for --attachJán Tomko2014-10-012-1/+22
| | | | | | | | | | | | | | | The virDomainOpenGraphics API cannot label the socket we pass to it. Prefer virDomainOpenGraphicsFD (if building with libvirt 1.2.8 or later) which creates the socket for us and works with SELinux too. Fall back to the old API if the new one is unsupported (i.e. the libvirtd on the host is older than the libvirt version virt-viewer was compiled against). Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1141228 Signed-off-by: Ján Tomko <jtomko@redhat.com>
* Let the user cancel the SPICE auth dialogFabiano Fidêncio2014-09-261-3/+3
| | | | | | | virt_viewer_auth_collect_credentials() was recently changed to return a boolean instead of an integer (2561c171). This change introduced a regression in the authentication dialog behavior, making it impossible for the user to cancel.
* Improve authentication error messagesFabiano Fidêncio2014-09-261-2/+35
| | | | | | | Adding a better error message to our default error message, based on the libvirt error. Also, the libvirt error is shown as debug. https://bugzilla.redhat.com/show_bug.cgi?id=1142742
* Simplify virt_viewer_auth_libvirt_credentials() return value logicFabiano Fidêncio2014-09-261-4/+4
| | | | | | | | | | As the function should return < 0 in error cases, let's explicitly return/set the return value to -1 in error cases. Otherwise, the function will return 0. This patch also fixes a regression introduced by (a5ce2ed3). https://bugzilla.redhat.com/show_bug.cgi?id=1142742
* Add example of an oVirt URI to the manpageJonathon Jongsma2014-09-261-0/+5
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1142769
* Add documentation for fullscreen monitor mappingJonathon Jongsma2014-09-262-7/+70
| | | | see https://bugzilla.redhat.com/show_bug.cgi?id=1142769
* Initialize fullscreen display map to fallbackJonathon Jongsma2014-09-261-0/+1
| | | | | | | If uuid was never set, we never checked the 'fallback' monitor map. Initializing the monitor map to the fallback value at startup solves this issue. This allows fallback mode to work with older servers that don't send the UUID.
* Unset app 'fullscreen' when leaving fullscreenJonathon Jongsma2014-09-261-10/+18
| | | | | | | | | | | | | | Previously, the fullscreen floating toolbar and the "toggle-fullscreen" hotkey (which maps to the menu item action) had slightly different methods of exiting fullscreen. The floating toolbar method unset the 'fullscreen' property on the application (which causes all windows to simultaneously exit fullscreen), whereas the hotkey did not. This had a side-effect of preventing the display from auto re-sizing if it was fullscreened again. After this change, both the hotkey and the toolbar button will unset the application-level 'fullscreen' property when exiting fullscreen mode. Resolves: rhbz#1022608
* VirtViewerDisplayVnc: set 'session' propertyJonathon Jongsma2014-09-243-5/+7
| | | | | | Set the display's session property in the constructor. If the session is not set, then virt_viewer_display_get_session() doesn't return anything useful.
* Make default window size a bit more usefulJonathon Jongsma2014-09-241-2/+2
| | | | | | | | Currently, windows have a default size of 400x400 pixels. This is a strange aspect ratio for a display, and it is also too small to be useful for much. Since the default window size determines the initial size of newly-enabled displays, it would be nice if we used a slightly better size.
* Set initial window size to display desktop sizeJonathon Jongsma2014-09-241-0/+2
| | | | | | | | | When setting the 'display' for a VirtViewerWindow, the initial size for that window should be the size of the remote display. So we synthesize a desktop resize event when setting a new display for a window. This is only done for enabled displays. Disabled displays generally have a size of 0x0, which would result in the window being at it's minimum size, so just allow the window to use its default size.
* Create windows on demand, not at startupJonathon Jongsma2014-09-241-43/+70
| | | | | | | | | | | | | | | Previously, a window was created at startup for each display, even if the display was not enabled. This resulted in a fixed 1:1 association between windows and remote displays. Since there was always one window created at startup to display status messages (the "main window"), this was always associated with remote display #1. But if the first remote display was not enabled, we ended up with a extra black window with a message saying ("Waiting for display 1..."). By creating windows on demand, we can re-use the "main window" for any arbitrary display, even if it's not display #1. Resolves: rhbz#1032939
* VirtViewerApp: store windows in a listJonathon Jongsma2014-09-243-122/+104
| | | | | Use a list to store the application's windows. This is another step towards separating the window from the guest display ID.
* VirtViewerDisplay: add convenience API for getting nthJonathon Jongsma2014-09-242-0/+7
| | | | | | | g_object_get(...) can be cumbersome, so add convenience API for getting the display ID ("nth-display") property: virt_viewer_display_get_nth()
* App: keep hash table of displaysJonathon Jongsma2014-09-241-0/+16
| | | | | This is part of a re-factoring that will de-couple the client window from the remote display id.
* Don't show extra screens in fullscreen modeJonathon Jongsma2014-09-242-2/+8
| | | | | | | | | | | | | | When using the fullscreen display mapping configuration file, extra monitors could end up enabled by mistake. This was because virt_viewer_app_get_initial_monitor_for_display would end up returning Nmonitor = Ndisplay when the display map hash lookup failed. In reality, when a display map is specified, but the hash lookup fails, the display should not be enabled. This function now returns -1 to distinguish this case, and the display is not enabled when this value is returned. Resolves issue described at https://bugzilla.redhat.com/show_bug.cgi?id=1129477#c9
* Move monitor mapping into app_window_try_fullscreen()Jonathon Jongsma2014-09-241-9/+7
| | | | | | | | Rather than requiring all callers to calculate the initial monitor mapping before calling app_window_try_fullscreen, move the responsibility for calculating the correct monitor into this function. This makes it less likely that somebody will forget and a display will get placed on the wrong monitor.
* Don't unref 'display' in VirtViewerDisplaySpice::finalizeChristophe Fergeau2014-09-231-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right after being created, the SpiceDisplay 'display' private member is added to the VirtViewerDisplaySpice GTK+ container with gtk_container_add. This call will take ownership of the floating reference that SpiceDisplay got upon creation. This means VirtViewerDisplaySpice::display is a pointer to SpiceDisplay, but it must not be unref'ed when the object is destroyed as we don't own that reference. As the container which owns the reference is the VirtViewerDisplaySpice instance itself, we don't need to take an additional reference here. This fixes a crash when exiting remote-viewer after connecting to a SPICE VM: #0 0x00007ffff3f33a81 in g_type_check_instance_is_fundamentally_a (type_instance=0x874500, fundamental_type=80) at gtype.c:3981 #1 0x00007ffff3f19f96 in g_object_unref (_object=0x874500) at gobject.c:3067 #2 0x000000000042a1ea in virt_viewer_display_spice_finalize (obj=0x6ebc30) at virt-viewer-display-spice.c:65 #3 0x00007ffff3f1a257 in g_object_unref (_object=0x6ebc30) at gobject.c:3170 #4 0x0000000000428de7 in destroy_display (data=0x6ebc30) at virt-viewer-session-spice.c:649 #5 0x00007ffff3bbb51b in g_ptr_array_foreach (array=0x7e12a0, func=0x428d71 <destroy_display>, user_data=0x0) at garray.c:1502 #6 0x00007ffff3bbaadf in ptr_array_free (array=0x7e12a0, flags=FREE_SEGMENT) at garray.c:1088 #7 0x00007ffff3bbaa10 in g_ptr_array_unref (array=0x7e12a0) at garray.c:1036 #8 0x00007ffff3bcf9bd in g_data_set_internal (datalist=0xa0adb0, key_id=1622, new_data=0x0, new_destroy_func=0x0, dataset=0x0) at gdataset.c:407 #9 0x00007ffff3bcfe74 in g_datalist_id_set_data_full (datalist=0xa0adb0, key_id=1622, data=0x0, destroy_func=0x0) at gdataset.c:670 #10 0x00007ffff3f1a771 in g_object_set_data (object=0xa0ada0, key=0x437252 "virt-viewer-displays", data=0x0) at gobject.c:3461 #11 0x0000000000429b56 in virt_viewer_session_spice_channel_destroy (s=0x6eb910, channel=0xa0ada0, session=0x8cb3a0) at virt-viewer-session-spice.c:854 #12 0x00007ffff3f12d81 in g_cclosure_marshal_VOID__OBJECT (closure=0x8e8fd0, return_value=0x0, n_param_values=2, param_values=0x7fffffffcd80, invocation_hint=0x7fffffffccc0, marshal_data=0x0) at gmarshal.c:1272 #13 0x00007ffff3f0e143 in g_closure_invoke (closure=0x8e8fd0, return_value=0x0, n_param_values=2, param_values=0x7fffffffcd80, invocation_hint=0x7fffffffccc0) at gclosure.c:768 #14 0x00007ffff3f2aef0 in signal_emit_unlocked_R (node=0x7c1f20, detail=0, instance=0x6eb910, emission_return=0x0, instance_and_params=0x7fffffffcd80) at gsignal.c:3553 #15 0x00007ffff3f2a1f3 in g_signal_emit_valist (instance=0x6eb910, signal_id=219, detail=0, var_args=0x7fffffffd058) at gsignal.c:3309 #16 0x00007ffff3f2a746 in g_signal_emit (instance=0x6eb910, signal_id=219, detail=0) at gsignal.c:3365 #17 0x00007ffff529d784 in spice_session_channel_destroy (session=0x6eb910, channel=0xa0ada0) at spice-session.c:1990 #18 0x00007ffff529ed25 in spice_channel_dispose (gobject=0xa0ada0) at spice-channel.c:153 #19 0x00007ffff52acd26 in spice_display_channel_dispose (object=0xa0ada0) at channel-display.c:136 #20 0x00007ffff3f1a132 in g_object_unref (_object=0xa0ada0) at gobject.c:3133 #21 0x00007ffff52a4afb in spice_channel_delayed_unref (data=0xa0ada0) at spice-channel.c:2156 #22 0x00007ffff3bf21d1 in g_idle_dispatch (source=0xa35a00, callback=0x7ffff52a49f3 <spice_channel_delayed_unref>, user_data=0xa0ada0) at gmain.c:5320 #23 0x00007ffff3bef8eb in g_main_dispatch (context=0x68a920) at gmain.c:3064 #24 0x00007ffff3bf0661 in g_main_context_dispatch (context=0x68a920) at gmain.c:3663 #25 0x00007ffff3bf0853 in g_main_context_iterate (context=0x68a920, block=1, dispatch=1, self=0x6c8c60) at gmain.c:3734 #26 0x00007ffff3bf0c7c in g_main_loop_run (loop=0x889b20) at gmain.c:3928 #27 0x00007ffff69be44f in gtk_main () at gtkmain.c:1207 #28 0x0000000000431896 in main (argc=1, argv=0x7fffffffd648) at remote-viewer-main.c:183
* Do not fail when the auth dialog is cancelledFabiano Fidêncio2014-09-231-7/+12
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1145460
* Revert changes related to numpad acceleratorsFabiano Fidêncio2014-09-233-45/+0
| | | | | | | | | | | | | | | | | | | | Due to a GTK+ limitation and bad testing from my side, I've pushed two patches trying to add support to use Ctrl + {+, -, 0} from numpad to control zoom-in, zoom-out and zoom-reset. Unfortunately, with the first patch (3a168815) I've duplicated the menu items related to the zoom functions. With the second one (55cdb986), provided to not show the duplicated menu items, we came back to the initial state, where the numpad accelerators don't work. So, in resume, multiple accelerators in a GTK+ widget are only supported on applications using GApplication, what is not our case and won't be till we drop the GTK+2 support. Revert "Do not show duplicated menu items" and Revert "Add support to use numpad accelarators for zoom-{in.out,reset}" This reverts commits 55cdb9867df05f1c4f6c8e569a6f0c1e0bc28d99 and 3a168815b738076526ba0f3e9a82e6fb1db482e9.
* Remove inaccurate G_GNUC_UNUSEDChristophe Fergeau2014-09-221-1/+1
| | | | The 'user_data' variable is used in the callback.
* Add support to view the password entry contentFabiano Fidêncio2014-09-172-0/+24
| | | | | Allow users to check if the entered password is right and/org modify the password easily in case it's wrong.
* Mark all strings for translation in the auth dialogFabiano Fidêncio2014-09-152-3/+4
| | | | | A few strings weren't marked for translation in the authentication dialog.
* Do not show duplicated menu itemsFabiano Fidêncio2014-09-151-3/+3
| | | | | | When the support to use numpad accelerators for zoom-{in,out,reset} was added (3a168815), by mistake, we have added duplicated buttons in View -> Zoom.
* Fix --without-spice-gtk --with-ovirt buildChristophe Fergeau2014-09-121-47/+60
| | | | | | | | | | | | | | | | | | The oVirt foreign menu support reused some existing bits from the older SPICE controller foreign menu code. However, this controller code is only built when spice-gtk support is built, while the oVirt foreign menu code could be used with VNC as well. Trying to build the ovirt foreign menu code without spice-gtk causes build issues due to missing functions, or missing declarations, ... The libgovirt/spice-gtk code which is entangled is the code to update the foreign menu when its content changes, or when a new window is opened. Making the oVirt-specific code independant from the spice-gtk-specific code is not too complicated, but this comes at the expense of a bit of code duplication, but this is only simple code iterating over the GHashTable storing the opened windows. Resolves: rhbz#1127156
* Add translatable file to POTFILES.inChristophe Fergeau2014-09-121-0/+1
|
* Remove extra ref on SpiceDisplayJonathon Jongsma2014-09-111-1/+1
| | | | | There's no need to ref the SpiceDisplay widget when adding it to a container. The container will take its own ref.
* VirtViewer: Fix memory leaksJonathon Jongsma2014-09-111-0/+4
| | | | Don't leak priv->uri or priv->domkey from VirtViewer class
* Don't print warning for missing comment in config fileJonathon Jongsma2014-09-051-1/+1
| | | | Change g_warning to g_debug as suggested by Marc-Andre
* Change collect_credentials() to return a booleanJonathon Jongsma2014-08-264-15/+16
| | | | | | Instead of returning 0 for success and -1 for failure, change to a boolean success value to be more consistent with the rest of the virt-viewer code.
* Auth: fix leak of usernameJonathon Jongsma2014-08-261-6/+5
| | | | | When collect_credentials() returns a failure status, 'username' was potentially leaked.
* remote-viewer: oVirt username review fixesJonathon Jongsma2014-08-192-3/+7
| | | | | | Minor fixes from patch review rhbz#1061826
* Force displays to update geometry when agent connectsFabiano Fidêncio2014-08-193-0/+9
| | | | | | | | We have to force displays to update geometry when the agent connects to ensure the client will have the guest with the right resolution when the guest has rebooted or the agent has crashed. https://bugzilla.redhat.com/sho_bug.cgi?id=1021841
* Fix gcc warning (unused-parameter)Fabiano Fidêncio2014-08-191-1/+3
|
* Fix gcc warning (missing-prototypes)Fabiano Fidêncio2014-08-191-0/+1
|
* Add support to use numpad accelarators for zoom-{in.out,reset}Fabiano Fidêncio2014-08-193-0/+45
| | | | | | | | As virt-viewer uses GtkAccelMap for shortcuts and that GTK only can have one key binding per accelerator (in accel_map_add_entry), let's also add support specificly for the numpad keys in the virt-viewer code https://bugzilla.redhat.com/show_bug.cgi?id=883433
* Don't check for NULL when it never can happenFabiano Fidêncio2014-08-191-1/+1
|
* Create foreign menu from .vv file informationChristophe Fergeau2014-08-183-0/+197
| | | | | | | | | | | | | When the .vv file has an [ovirt] section, we should try to create a foreign menu out of it. This will allow remote-viewer to offer a menu to change the currenty inserted cdrom. Contrary to the ovirt:// case when we already have fetched an OvirtAPI and OvirtVm instance in order to get the SPICE/VNC connection details, when working from a .vv file, we'll need to get them from the REST API. Authentication should happen through the JSESSIONID cookie, if that fails we want to give up on using the foreign menu, so we don't need to set up authentication callbacks.
* Add ovirt-specific properties to VirtViewerFileChristophe Fergeau2014-08-182-0/+116
| | | | | They will be useful to implement foreign menu support through oVirt REST API
* Add 'group' argument to VirtViewerFile helpersChristophe Fergeau2014-08-181-69/+84
| | | | | | For foreign menu support, we'll need a way to pass oVirt-specific information in the .vv file. This will be done through an additional [ovirt] section, this commit is in preparation for that.
* ovirt: Use OvirtForeignMenu classChristophe Fergeau2014-08-181-0/+82
| | | | | After the previous commit which introduced the OvirtForeignMenu class, we can now make use of it in the remote-viewer UI code.
* ovirt: Add OvirtForeignMenu classChristophe Fergeau2014-08-184-1/+774
| | | | | | | This class is used to implement the so-called oVirt 'foreign menu' which is a menu populated with ISO images available on the oVirt instance that the user can dynamically insert into the virtual machine he is currently viewing.
* ovirt: Remove extra '/' from oVirt URIChristophe Fergeau2014-08-181-1/+2
| | | | | | | | | | | | The 'path' part of the URI will always start with a '/' when present as this is what separates it from the hostname. When rebuilding the final URI, the current code inserts a '/' by itself between the hostname and the path, which results in URIs with an extra '/': https://ovirt.example.com//some/path/api This is not only cosmetic as this can cause issues with cookie handling if libgovirt accesses //some/path/api while the cookie is set for /some/path/api.
* remote-viewer: allow username in ovirt URIsJonathon Jongsma2014-08-182-5/+25
| | | | | | | | | | | | When the user launches remote-viewer with an ovirt URI of the form ovirt://user@host/vmname Pre-populate the authentication dialog with the specified username. We don't support specifying the password on the commandline, since that is a potential security risk. rhbz#1061826
* Don't use fallback ca-file when launching vv-fileJonathon Jongsma2014-08-151-1/+4
| | | | | | | | | When launching from a vv-file, we want to use the ca specified in the vv file and not load additional certs from the fallback ca-file. This ensures that the ca-file property of the spice session is unset when loading a ca from a vv-file. Resolves: rhbz#1127762
* Write vm name to config file as commentJonathon Jongsma2014-08-071-0/+14
|
* Change per-guest fullscreen config formatJonathon Jongsma2014-08-072-36/+99
| | | | | | | | | | | use <display>:<monitor>;<display>:<monitor> instead of simply implying the display from the array index (e.g. <monitor>;<monitor>). This allows you to set up sparse guest displays (e.g. display 1 + 3). For example, to configure display 1 to be fullscreen on monitor 2 and display 2 to be fullscreen on monitor 3: monitor-mapping=1:2;2:3