summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-session-spice.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure auto-conf is only done onceJonathon Jongsma2013-11-201-0/+9
| | | | | | Auto-conf should only happen at startup. It is triggered from several places due to the somewhat unreliable ordering of events, but that doesn't mean we want to run it several times. This patch ensures that we only do it once.
* Add ability to define custom display->monitor mapping per vmJonathon Jongsma2013-11-201-12/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fullscreen mode generally just assigns display 1 to monitor 1, display 2 to monitor 2, etc. For custom setups, you can define a monitor mapping in the settings keyfile per-vm. This requires a vm uuid (so only works in virt-viewer or on versions of spice-server that send the uuid over the wire). The format is pretty basic: [6485b20f-e9da-614c-72b0-60a7857e7886] monitor-mapping=2;3 The group name ("6485b20f-e9da-614c-72b0-60a7857e7886") is the uuid id of the vm. This group has a single key: monitor-mapping. This key is an array of integers describing the order in which to assign the monitors to a guest display. Any monitors that are not listed in this array will not be configured at startup. For instance: monitor-mapping=2;1 will attempt to configure 2 displays on the guest and assign the first display to monitor 2 and the second display to monitor 1. monitor-mapping=2 will only configure a single display on the guest and place it on the second monitor. Any monitor numbers listed in the keyfile are greater than the number of monitors that are physically present, they will be ignored.
* session: Don't hold VirtViewerDisplay refs on channel destroyChristophe Fergeau2013-11-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VirtViewerSessionSpice creates a reference-holding VirtViewerDisplay array and associates it with the display SpiceChannel with g_object_set_data(channel, "virt-viewer-displays"). When virt_viewer_session_spice_channel_destroy() is called and the display channel is being destroyed, we should ensure these VirtViewerDisplay references are dropped or the displays could outlive the session. In my testing (start qemu with a f20 live cd, connect to it, when the kernel has started booting and qxl is initialized (4 displays listed in the display submenu), kill qemu), I was getting "invalid unclassed pointer in cast to 'VirtViewerSessionSpice'" warnings through #0 0x00000035bac504e9 in g_logv (log_domain=0x35bb039aa4 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffc7c0) at gmessages.c:989 #1 0x00000035bac5063f in g_log ( log_domain=log_domain@entry=0x35bb039aa4 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x35bb041010 "invalid unclassed pointer in cast to '%s'") at gmessages.c:1025 #2 0x00000035bb032e09 in g_type_check_instance_cast (type_instance=0x665580, iface_type=<optimized out>) at gtype.c:4025 #3 0x0000000000426e9f in get_main (self=0x894190) at virt-viewer-display-spice.c:92 #4 0x0000000000426ece in show_hint_changed (self=0x894190) at virt-viewer-display-spice.c:100 #5 0x00000035bb010298 in g_closure_invoke (closure=0x9f47c0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffcad0, invocation_hint=invocation_hint@entry=0x7fffffffca70) at gclosure.c:777 #6 0x00000035bb02235d in signal_emit_unlocked_R (node=node@entry=0x651f60, detail=detail@entry=1782, instance=instance@entry=0x894190, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcad0) at gsignal.c:3586 #7 0x00000035bb02a0f2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffcc60) at gsignal.c:3330 #8 0x00000035bb02a3af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386 #9 0x00000035bb014945 in g_object_dispatch_properties_changed (object=0x894190, n_pspecs=92, pspecs=0x0) at gobject.c:1047 #10 0x00000035bb017019 in g_object_notify_by_spec_internal (pspec=<optimized out>, object=0x894190) at gobject.c:1141 #11 g_object_notify (object=0x894190, property_name=<optimized out>) at gobject.c:1183 #12 0x000000000041b617 in virt_viewer_display_set_show_hint (self=0x894190, mask=1, enable=0) at virt-viewer-display.c:659 #13 0x000000000042712c in update_display_ready (self=0x894190) at virt-viewer-display-spice.c:156 #14 0x00000035bb010298 in g_closure_invoke (closure=0x6ba480, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffcfb0, invocation_hint=invocation_hint@entry=0x7fffffffcf50) at gclosure.c:777 #15 0x00000035bb02235d in signal_emit_unlocked_R (node=node@entry=0x651f60, detail=detail@entry=1798, instance=instance@entry=0xa2c250, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcfb0) at gsignal.c:3586 #16 0x00000035bb02a0f2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd140) at gsignal.c:3330 #17 0x00000035bb02a3af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386 #18 0x00000035bb014945 in g_object_dispatch_properties_changed (object=0xa2c250, n_pspecs=92, pspecs=0x0) at gobject.c:1047 #19 0x00000035bb017019 in g_object_notify_by_spec_internal (pspec=<optimized out>, object=0xa2c250) at gobject.c:1141 #20 g_object_notify (object=0xa2c250, property_name=<optimized out>) at gobject.c:1183 #21 0x00007ffff7044d9a in update_ready (display=0xa2c250) at spice-widget.c:257 #22 0x00007ffff7044df0 in set_monitor_ready (self=0xa2c250, ready=0) at spice-widget.c:265 #23 0x00007ffff7049bb3 in primary_destroy (channel=0x9f40b0, data=0xa2c250) at spice-widget.c:2131 #24 0x00007ffff704afd5 in channel_destroy (s=0x892880, channel=0x9f40b0, data=0xa2c250) at spice-widget.c:2444 #25 0x00000035bb010298 in g_closure_invoke (closure=0xa27850, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffd570, invocation_hint=invocation_hint@entry=0x7fffffffd510) at gclosure.c:777 #26 0x00000035bb02235d in signal_emit_unlocked_R (node=node@entry=0x7cf600, detail=detail@entry=0, instance=instance@entry=0x892880, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd570) at gsignal.c:3586 #27 0x00000035bb02a0f2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd700) at gsignal.c:3330 #28 0x00000035bb02a3af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386 #29 0x00007ffff6ceba87 in spice_session_channel_destroy (session=0x892880, channel=0x9f40b0) at spice-session.c:1923 #30 0x00007ffff6cecf05 in spice_channel_dispose (gobject=0x9f40b0) at spice-channel.c:149 #31 0x00007ffff6cf912c in spice_display_channel_dispose (object=0x9f40b0) at channel-display.c:136 #32 0x00000035bb014ee8 in g_object_unref (_object=0x9f40b0) at gobject.c:3160 #33 0x00007ffff6cf300c in spice_channel_delayed_unref (data=0x9f40b0) at spice-channel.c:2135 #34 0x00000035bac492a6 in g_main_dispatch (context=0x67a6b0) at gmain.c:3066 #35 g_main_context_dispatch (context=context@entry=0x67a6b0) at gmain.c:3642 #36 0x00000035bac49628 in g_main_context_iterate (context=0x67a6b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3713 #37 0x00000035bac49a3a in g_main_loop_run (loop=0x7baf60) at gmain.c:3907 #38 0x00000035bfdaa2d5 in gtk_main () at gtkmain.c:1158 #39 0x000000000042caf1 in main (argc=1, argv=0x7fffffffdc78) at remote-viewer-main.c:179 In that backtrace, the last ref to the VirtViewerDisplay instances is held by the SpiceChannel:virt-viewer-displays object data which will only be released after completion of spice_display_channel_dispose()
* Remove obsolete use of SpiceChannel:virt-viewer-display object dataChristophe Fergeau2013-11-201-2/+1
| | | | | | | Commit 0d58d9c72 removed the setting of the SpiceChannel:virt-viewer-display object data, but there was still a call to g_object_get_data() trying to use it. Since it's only used to output a debug log, we can remove this call and fix up the debug log.
* Drop basic fullscreen modeJonathon Jongsma2013-11-131-7/+1
| | | | | | Remove the distinction between --full-screen and --full-screen=auto-conf. Just make --full-screen behave like auto-conf did. There's really no advantage to having two slightly different fullscreen startup modes.
* Don't freeze property notifications when adding new displaysJonathon Jongsma2013-10-181-4/+0
| | | | | | | | | Freezing property notifications prevents VirtViewerDisplaySpice from synchronizing its fullscreen/auto-resize state with the base class until after the notifications are thawed. During the time that notifications were frozen, an allocation happens. The action we take on an allocation event depends on the current state of the auto_resize variable, so this can result in an unwanted resize.
* spice: show an error dialog if password is invalidMarc-André Lureau2013-08-081-0/+7
| | | | | | | Error message should show up when input the wrong password for spice guests as vnc guests. https://bugzilla.redhat.com/show_bug.cgi?id=990883
* Add VirtViewerSession::software-smartcard-reader propertyChristophe Fergeau2013-07-311-6/+69
| | | | | | | This property will be set to TRUE when a software smartcard reader is available, and FALSE otherwise. This property can only be TRUE when using SPICE and when smartcard support is enabled, and when both smartcard certificates and smartcard db directory are set.
* usbredir: Don't depend on channel orderingHans de Goede2013-07-061-13/+15
| | | | | | | | | | | | | Before this patch-set virt-viewer was calling spice_session_has_channel_type( session, SPICE_CHANNEL_USBREDIR) from the session-initialized signal handler, So as soon as the display channel gets added to the session, the check was done. This causes the check to return FALSE for usbredir capable vms if the usbredir channel(s) get added to the session after the display channed. This patch refactors things to not depend on channel creation order. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* spice-session: use a more robust signal connectMarc-André Lureau2013-05-171-4/+4
| | | | | | The Spice session may outlive the virt-viewer session, due to it's async nature. Use the more robust virt_viewer_signal_connect_object() to fix delayed potential crashes.
* misc: fix typoMarc-André Lureau2013-05-131-1/+1
|
* spice: forward secure-channelsMarc-André Lureau2013-04-151-0/+6
| | | | This needs spice-gtk >= 0.19.7 and will warn with lower version
* Do not disable extra client monitorsMarc-André Lureau2013-03-231-1/+0
| | | | | | | This allows reconfiguration of extra monitors whenever the agent is back, for example after reboot. https://bugzilla.redhat.com/show_bug.cgi?id=918997
* spice: always send auto-conf on agent connectionMarc-André Lureau2013-03-231-15/+13
| | | | | | | | Restore the auto-conf client monitor configuration whenever the agent is started. This ensures the guest has the expected number of monitors enabled when rebooting in fullscreen. https://bugzilla.redhat.com/show_bug.cgi?id=918997
* file: add version field, raise an error if incompatibilyMarc-André Lureau2013-03-081-1/+2
| | | | | | The virt-viewer connection file can now have a version=0.5 field. If the virt-viewer version opening the connection doesn't provide at least that version, an error is raised with the version required.
* Allow app_initial_connect() to raise an errorMarc-André Lureau2013-03-081-2/+2
|
* spice: add proxy configuration to connection fileMarc-André Lureau2013-01-291-0/+6
|
* session-spice: Cast CA string to gunit8 pointerMichal Privoznik2012-12-051-1/+1
| | | | | | | SpiceSession has 'ca' property which is type of GByteArray*. However, when we read the property from file, we read it as string. For conversion g_byte_array_new_take() is used which takes given pointer as guint8* so we need to do the cast.
* spice: learn to connect from fileMarc-André Lureau2012-11-271-1/+90
|
* session: add virt_viewer_session_mime_type()Marc-André Lureau2012-11-271-0/+7
|
* spice: the session is connected when main channel openedMarc-André Lureau2012-11-211-2/+1
| | | | | | | The previous change in 399aae55aa384bf91dff0fc770497c0d5f935fa9 rely on correct session-connected signal. However, the spice backend is emiting it too early, when the main channel is created, where it should wait until it is connected instead.
* Don't free SPICE ticket twiceChristophe Fergeau2012-10-011-1/+0
| | | | | | | Commit 2201a5a was supposed to free a SPICE ticket leak, but it's actually introducing a double-free as the SPICE ticket is unconditionally freed at the end of virt_viewer_session_spice_main_channel_event
* Add VirtViewerSession::session-display-updatedMarc-André Lureau2012-07-231-4/+14
| | | | | Rebuild menu when agent is connected. Only when the agent is running may a display be enabled/disabled.
* Hook up handling of MonitorsMarc-André Lureau2012-07-231-10/+79
| | | | | | Rely on spice-gtk display channel monitors property to manage displays. The same display channel may now provide several monitors, the SpiceDisplay widget must be told which monitor to display
* spice: improve fullscreen=auto-confMarc-André Lureau2012-07-231-0/+4
| | | | | Do keep client monitor position, do not align monitors automatically. The align property is only available since v0.12.101.
* Don't leak SPICE ticketChristophe Fergeau2012-06-131-0/+1
|
* spice: use weak references to display channelMarc-André Lureau2012-05-171-5/+5
| | | | | | | | | | | | Fix switch-host migration with Spice. spice-gtk doesn't like channels staying around when they should be destroyed/finalized, ie removed from session. spice-gtk should probably learned to handle better the case of non cooperating clients, and be able to dissociate a channel from a session without waiting for it to be disposed, but for now, the relation is quite tight.
* Ensure windows are destroyed when display closesDaniel P. Berrange2012-05-041-0/+4
| | | | | | | | | | | When running virt-viewer with the --reconnect argument, when the session closes, the VirtViewerWindow instances were being freed, but not the GtkWindow itself. So the orphaned window stayed around doing nothing. The GtkBuilder instance was also leaked. Fix these two leaks & also add some debugging to help future troubleshooting
* Change 'OK' button to 'Close' button in USB device selectionDaniel P. Berrange2012-05-021-1/+1
| | | | | The USB device selection applies immediately, so the dialog should be using 'Close' instead of 'OK' for its primary button
* Add debugging when performing fullscreen auto-configurationDaniel P. Berrange2012-04-251-1/+8
|
* usbredir: listen for device-error signalHans de Goede2012-03-291-1/+4
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* spice: handle switch-host eventMarc-André Lureau2012-03-211-6/+13
| | | | | | | | | Do not disconnect session when switching host (non-seamless migration method). Also, handle a bit better main channel events and do not disconnect on unknown events, however raise unhandled event message to warning level.
* spice: remove usage of deprecated audio apiMarc-André Lureau2012-03-211-8/+6
|
* spice: implement --fullscreen=auto-confMarc-André Lureau2012-03-211-2/+60
| | | | | | | - auto-conf is an optionnal argument to --fullscreen: it will set the guest display configuration to match the client display configuration, by sending the client monitors size and position to capable guests.
* session-spice: Delay the disconnected signal till all channels are closedHans de Goede2012-03-061-4/+13
| | | | | | | | | | | | | | | | | | | | Before this patch session-spice would emit the disconnected signal as soon as the main channel is closed, but other channels may still be open at that time and raising the disconnected signal usally leads to the app class calling gtk_main_quit, at which point the other channels never get properly finalized (as there co-routines still hold a reference to them). This is esp. bad for usbredir channels as these re-attach the kernel driver for redirected devices when finalized. So exiting without properly finalizing them leads to the formerly redirected devices not being usuable until the driver is manually reloaded or the device is unplugged and re-plugged (the kernel does not automatically re-bind kernel drivers when userspace closes a usbfs node). This patch fixes this by delaying the emitting of the disconnect signal until the last channel has been destroyed. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* session-spice: dispose should chain up to dispose not finalize!!Hans de Goede2012-03-061-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* usbredir: Gnome HIG-ify USB device selection dialogHans de Goede2012-03-061-1/+4
| | | | | | | These changes match the changes already made to the spice-gtk usb device selection widget to match the spacing advised by the Gnome HIG. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* usbredir: Shrink the usb device selection dialog when devices are unpluggedHans de Goede2012-03-061-0/+11
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* spice: fix connecting via ssh to a password-protected serverMarc-André Lureau2012-03-011-1/+8
| | | | | | spice_session_connect() will attempt to connect directly to the server, we need to continue calling spice_session_open_fd() for ssh tunnel to work.
* spice: fix double unref of main channelMarc-André Lureau2012-03-011-10/+3
| | | | | | | | | | | | | When doing unref() on a channel, channel-destroy signal may be emitted during object dispose time, and it will attempt to unref() the channel again likely leading to a crash. It may be that spice-gtk should have a different/simpler object life-cycle model, but it's also a good assumption to not take strong references on the channels, but just keep a weak reference as the session is really the channel life-cycle manager. https://bugzilla.redhat.com/show_bug.cgi?id=797082
* spice: implement smartcard-{insert,remove} virtual methodsMarc-André Lureau2012-02-221-3/+17
|
* Add back compat for GObject 2.22 which lacks GBindingDaniel P. Berrange2012-02-161-0/+5
|
* Extract tlsPort for SPICE and use it to enable secure connectionsDaniel P. Berrange2012-02-141-6/+8
|
* Ensure auth popup windows have correct transient parentDaniel P. Berrange2012-02-081-2/+7
|
* Implement SPICE desktop resizing that takes account of zoom levelDaniel P. Berrange2012-02-081-1/+25
| | | | | | | | | | | | | The standard SPICE widget guest resize implementation does not take into account the zoom level settings in virt-viewer, because it has no knowledge of this functionality. The guest resize can, however, be done by calling spice_main_set_display() directly. This allows virt-viewer to resize the guest taking into account zoom levels. ie, if virt-viewer is run with --zoom 50 and the window is resized to 400x300, then the guest agent should be told to set its resolution to 800x600
* Add config.h to every source fileDaniel P. Berrange2012-02-061-0/+2
|
* Update copyright headersDaniel P. Berrange2012-02-061-2/+2
|
* Convert TABS to spaces & reindent everywhereDaniel P. Berrange2012-02-061-247/+246
|
* Only make the USB device selection sensitive when the vm is USB capableHans de Goede2012-02-061-0/+13
|
* Add a menu entry for USB device selectionHans de Goede2012-02-061-4/+35
|