Age | Commit message (Collapse) | Author | Files | Lines |
|
This simplifies the following commit which uses even more
SPICE_MAIN_CHANNEL macro, and makes the code unnecessarily heavy.
|
|
Allow to easily override default max-clipboard value with environment
variable.
|
|
Attempt to send very large clipboard data may easy cause OOM
abort, either in gdk - some patch are proposed to improve the situation,
or in spice-gtk itself.
Let's have a property that blocks unreasonably big clipboard data from
being processed (by default 100mb). Users willing to send larger data
can use the send basic drag-drop send file instead, or tweak the
property value.
|
|
Currently, spice-gtk will look in $HOME/.spicec/spice_truststore.pem
by default for its trust certificate store (to verify the certificates
used during SPICE TLS connections).
However, these days, progress is under-way to have a system-wide
certificate store [1].
In order to use it, we only need to call SSL_CTX_set_default_verify_paths()
and it will automatically use the shared system CA store if the distro
is properly setup.
We only try to use that store if there was no user-provided CA file to use,
or if we failed to load it.
[1] https://fedoraproject.org/wiki/Features/SharedSystemCertificates
|
|
configure help text says that by default python will be used automatically
if appropriate, however this only means that on !windows and !gtk3, we will
force build of the python bindings, and fail if any needed package to build
them is missing.
This commit improves on the current checks so that when autodetecting
python, if a package is missing then build of the bindings is silently
disabled rather than failing.
|
|
Commit daa4ece tried to disable building of python bindings on Windows by
default, but in doing so, it also disabled building of python bindings by
default when we are building neither for Windows nor for gtk3.
|
|
test ... -o test ... is not a valid shell construct, change it to
test ... || test ... as this is more portable than test ... -o ...
This was causing a warning when running configure.
|
|
|
|
coroutine_init() can fail, but spice-channel.c was not checking its return
value, which could lead to some crashes if coroutine_init() failed and we
then try to use coroutine_yieldto()
|
|
The coroutine_init function mmap's a stack for the
ucontext coroutine, but nothing ever munmaps it.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
If we fail to mmap the stack, abort the processs rather
than returning an error. This is standard practice in
glib apps, and the caller was not checking the
coroutine_init() return code leading to memory corruption.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
The IN_MAIN_CONTEXT macro checks coroutine_self()->caller against NULL to
decide whether we are in the main context or not. However, this is an
implementation detail of the ucontext coroutine implementation, in the
gthread implementation, coroutine_self()->caller will be non-NULL even in
the main context.
This commit introduces a coroutine_is_main_context() method which each
coroutine backend implements. It turns out it can be implemented the same
way for each backend.
|
|
g_object_notify_main_context() was recently changed to automatically
detect whether we are running in the main context or not, and SpiceSession
is now using g_object_notify_main_context().
In order to achieve that, IN_MAIN_CONTEXT is used, but it's not safe
to be used before coroutine_init() is called. IN_MAIN_CONTEXT expands to
(coroutine_self()->caller == NULL), but coroutine_self() will be NULL when
using gthreads for the coroutine implementation until coroutine_init() has
been called.
Before coroutine_init() has been called, we'll always be running in the
main context, so we can just add a check for coroutine_self() != NULL to
IN_MAIN_CONTEXT to solve that issue.
|
|
When leaving a coroutine, it swaps back to where it came from, not to
the leader/main coroutine.
|
|
|
|
This creates a synchronization point and allows API users to rely on the fact
that they'll always get a UUID notification before all of the channels are
created.
|
|
Modify g_object_notify_main_conetxt() to work whether it's called from the main
context or a coroutine context. Change object notify calls in SpiceSession to
use g_object_notify_main_context() instead of g_object_notify().
|
|
This reverts commit a285e0187d15ad650f6524f3811072fa55b20617.
This API was not actually needed for what I intended to use it for. So revert
for now. We can always add it back if necessary in the future.
Conflicts:
gtk/spice-widget.c
|
|
In theory, zero-ing the surface shouldn't be necessary, as only
invalidated/painted region should be shown. However, this results in
less artifacts on resolution changes (probably some regions are painted,
but with masks, blend, copy etc), in particular on console after VM
reboot.
|
|
|
|
Add defensive g_return[_val]_if_fail(SPICE_IS_DISPLAY()) to all public API
|
|
Add spice_display_get_monitor_config() to get the current configuration of the
display.
|
|
|
|
|
|
glib log handler only check for a single 'all' value, mixing it with
other domains name will disable 'all' messages.
|
|
Update map-file and spice-glib-sym-file
|
|
SpiceSeession has a 'uuid' property that is a byte array, but clients often need
the uuid in string format (for writing to disk, etc). Rather than having each
client re-implement this, expose the utility function as public API in
spice-gtk.
|
|
Fix 998529, mono (invert) cursors not visible on a black background, by doing
simple edge detection on the cursor (this is done once when the cursor
is changed and then cached, cursors are 32x32 generally) and thus having
a cursor with contrast on both dark and light backgrounds.
When (if) GDK gets invert cursor support (wayland?) then we can just use
the cursor as is. Until then X doesn't provide any way I see of solving
this otherwise. The end result was tested with the I beam cursor that
the original bug was referring to (run putty on a windows 7 vm) and
looks ok to me.
Moving the core function to spice-util for testing.
|
|
|
|
This is useful in debug messages atm.
|
|
When exiting remote-viewer after authenticating through SASL, I got
this crash:
#0 0x0000000100a51870 in ?? ()
#1 0x000000314d20c53e in _sasl_log (conn=<optimized out>, level=5, fmt=0x7fffe49893e8 "DIGEST-MD5 client mech dispose")
at common.c:1985
#2 0x00007fffe4982d88 in digestmd5_client_mech_dispose (conn_context=0xaf1900, utils=0xaefd10) at digestmd5.c:4580
#3 0x000000314d208654 in client_dispose (pconn=0xaf0710) at client.c:332
#4 0x000000314d20b76b in sasl_dispose (pconn=0xa51898) at common.c:851
#5 0x00007ffff7602dc7 in channel_reset (channel=0xa52250, migrating=0) at spice-channel.c:2493
#6 0x00007ffff760f7b7 in spice_inputs_channel_reset (channel=0xa52250, migrating=0) at channel-inputs.c:615
#7 0x00007ffff76030ac in spice_channel_reset (channel=0xa52250, migrating=0) at spice-channel.c:2551
#8 0x00007ffff76031e0 in channel_disconnect (channel=0xa52250) at spice-channel.c:2570
#9 0x00007ffff760283d in spice_channel_coroutine (data=0xa52250) at spice-channel.c:2368
#10 0x00007ffff763d14b in coroutine_trampoline (cc=0xa51900) at coroutine_ucontext.c:58
#11 0x00007ffff763ce30 in continuation_trampoline (i0=10819840, i1=0) at continuation.c:49
#12 0x00000031342479c0 in ?? () from /lib64/libc.so.6
#13 0x0000000000a51cc8 in ?? ()
#14 0x0000000000000000 in ?? ()
It turns out that the sasl_callback_t data passed when calling
sasl_client_new() must be valid until sasl_dispose() is called. I could not
find mentions of this in the official documentation but
https://mail-archives.apache.org/mod_mbox/subversion-dev/201109.mbox/%3C20110908072256.GN25324@ted.stsp.name%3E
describes what happens.
Making the sasl_callback_t structure static should be enough to guarantee
that the data will stay around long enough.
|
|
When SPICE_DEBUG is set but --spice-debug is not used, we fail
to set G_MESSAGES_DEBUG to the log domain used by spice-gtk, which
causes debug messages not to be printed as one would expect.
|
|
If spice_util_set_debug() gets called before spice_util_get_debug(),
then the value set using spice_util_set_debug() will be overridden
by the result of g_getenv("SPICE_DEBUG") != NULL the first time
spice_util_get_debug() is called.
This causes remote-viewer --spice-debug to not enable debug as
advertised if SPICE_DEBUG is not set.
An alternate fix would have been to set debug_once.status to
G_ONCE_STATUS_READY but then we would lose the thread-safety
guarantees GOnce gives us.
|
|
After the previous commit, spice_channel_switch_protocol() is now
called when needed, but it's not doing anything. What happens is
that spice_channel_switch_protocol() triggers a channel disconnection
and then it queues an idle to reconnect (after having changed the
protocol version to be used).
When spice_channel_recv_link_hdr() returns, we need to jump out of
the coroutine to let the idle trigger and the new channel coroutine
be started. But jumping out of the coroutine will call channel_disconnect()
which calls channel_reset() which disables the idle switch_protocol()
just queued. This causes the connection attempt to be apparently
stuck with nothing happening.
Falling back to the older SPICE protocol is not the only situation
when we need to drop the current connection attempt and reconnect,
we also need to do that when the remote server returns
SPICE_LINK_ERR_NEED_SECURED to let the client know it needs to use
a secure port for this channel. This is handled by the 'switch_tls'
variable set in spice_channel_recv_link_msg and handled in
spice_channel_coroutine().
'switch_tls' does the same thing as spice_channel_switch_protocol(),
except that it calls spice_channel_connect() after channel_disconnect()
has been called, which means the idle queued by channel_connect()
won't get cleared.
This all that commit does, remove the spice_channel_switch_protocol()
method and use the same codepath as 'switch_tls' to handle the
reconnection.
|
|
This partially reverts b19acbc. This commit broke the fallback
to the old protocol as it added a check for c->peer_msg != NULL
before calling switch_protocol(), but mismatch between local
and remote protocol versions is detected before c->peer_msg is
allocated, so:
if (c->peer_msg != NULL && c->link_hdr.major_version != 1) {
SPICE_DEBUG("%s: error, switching to protocol 1 (spice 0.4)",
c->name);
spice_channel_switch_protocol(channel, 1);
return TRUE;
}
will never get triggered when c->peer_hdr.major_version !=
c->link_hdr.major_version
The crash described in b19acbc occurred when calling
spice_channel_recv_link_msg() in spice_channel_coroutine()
after a call to spice_channel_recv_link_hdr() failed and did
not set c->peer_msg.
This commit removes the c>peer_msg check done before calling
spice_channel_switch_protocol() so that it gets called when needed,
but makes sure that we return FALSE to indicate that an error happened
and that we need to reconnect. This way we won't try to call
spice_channel_recv_link_msg() when c->peer_msg is NULL.
|
|
The one we were using does not work properly with clang, causing
the build process to try to use -f/-W options that are not
supported by clang.
|
|
clipboard_get() exits when the clipboard data is received, or when the
agent connection state change. However, if the agent is already
disconnected, neither of those 2 conditions can be reached.
Check if the agent is connected before running loop, exit early if not.
|
|
Use swapped connection to pass data as first argument to signal handler.
|
|
spice_main_channel_reset_agent() reset connected state, and prevent
notify of property change.
This is a minor regression introduced in c3adb24425.
|
|
|
|
palette_get() used to return a ref, and palette_release() used to
release that ref.
Since ed877341, the palette is no longer refcount'ed, since its usage is
exclusively local in common/canvas code.
palette_release() shouldn't remove the palette from the cache.
https://bugzilla.redhat.com/show_bug.cgi?id=1011936
|
|
Signed-off-by: Alon Levy <alevy@redhat.com>
|
|
The usbredir channel uses spice_msg_in_raw to get its data, which uses
in->dpos to determine the msg size and that was no longer being set for
non sub-messages.
https://bugs.freedesktop.org/show_bug.cgi?id=69935
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Since 5f67178c, alt-tab is no longer grabbed by the client. The keyboard
hook still needs to handle WM_SYSKEY{DOWN,UP} messages.
https://bugzilla.redhat.com/show_bug.cgi?id=873341
|
|
|
|
|
|
Defaults to GStreamer on Windows, and PulseAudio otherwise atm.
|
|
The default configure sasl auto setting will error out if SASL is
missing. Instead, silentely skip sasl configure if detected missing.
|
|
As pointed out and verified on the ML after 0.21 release by Klaus
Hochlehnert.
|
|
|