Commit Graph

1844 Commits

Author SHA1 Message Date
Marc-André Lureau
8904dfc768 server: use a warning when disconnecting unresponsive client
The debug level is not visible by default, since it is an unsolicited
server behaviour, make it a warning.
2014-05-16 19:20:51 +02:00
Christophe Fergeau
719764f7ad docs: Fix make distcheck 2014-05-15 15:26:51 +02:00
소병철
3cb746329e Use PRI macros in printf to keep compatibility between 32/64bit system
gcc's some integer type definitions are different between 32/64bit system.
This causes platform dependency problem with printf function. However,
we can avoid this problem by using PRI macros that supports platform
independent printf.
2014-05-15 14:45:58 +02:00
Christophe Fergeau
e3da0c4f01 Fix submodule reference 2014-04-16 22:51:05 +02:00
Christophe Fergeau
91a6feb9f4 Add missing buffer (re)allocation to reds_sasl_handle_auth_steplen()
We need to make sure we have a buffer big enough to accomodate the data
sent by the coming SASL step.
2014-04-16 17:11:38 +02:00
Christophe Fergeau
27f968afd2 Call correct SASL helper in reds_handle_auth_sasl_step
sasl_handle_auth_start() was called instead of reds_sasl_handle_auth_step()
2014-04-16 17:11:38 +02:00
Christophe Fergeau
390a36ea34 Add G_GNUC_UNUSED annotations to async_read_handler args
2 of the arguments are not used, the G_GNUC_UNUSED annotation will make
this explicit.
2014-04-16 17:11:38 +02:00
Christophe Fergeau
e36c7efe81 Make struct AsyncRead/async_read_handler private
All users are now contained in reds_stream.c
2014-04-16 17:11:38 +02:00
Christophe Fergeau
17f89a348a Remove RedLinkInfo::async_read
9feed69 moved the async reader code to RedsStream so that it can be used
for the SASL authentication code. In particular, it introduced a
RedsStream::async_read member which is used by the SASL authentication code
for its async operations.

However, what was not done is to remove the now redundant
RedLinkInfo::async_read field. This causes failures when using SASL
authentication as the async read error callback is getting set
on the RedLinkInfo::async_read structure, but then the SASL code is trying
to use the RedeStream::async_read structure for its async IOs, which do not
have the needed error callback set.

This commit makes use of the newly introduced reds_stream_async_read()
helper in order to make use of RedsStream::async_read.
2014-04-16 17:11:38 +02:00
Christophe Fergeau
81427961bd Call AsyncRead variables 'async' instead of 'obj'
This is a more explicit name.
2014-04-16 17:11:38 +02:00
Christophe Fergeau
3dd4723e48 Add reds_stream_set_async_error_handler() helper
This replaces async_read_set_error_handler() which was unused. This sets a
callback to be called when an async operation fails.

We could pass the error_handler to each reds_stream_async_read() call, but as
we will be using the same one for all async calls, it's more convenient to set it
once and for all.
AsyncRead is going to be private to reds_stream.c in one of the next
commits, and the error handler will need to be set from reds.c,
hence the move to a public RedsStream method.
2014-04-16 17:11:38 +02:00
Christophe Fergeau
dc017bb9ae Introduce reds_stream_async_read() helper
This will allow to make RedsStream::async_read private
2014-04-16 17:11:38 +02:00
Christophe Fergeau
d9fa872a94 build-sys: Fix VPATH builds
Fixing this is a matter of picking the spice-common fix to generate the
(de)marshaller source files in the right place, and to adjust the compiler
flags to look for includes in the build directory as well.
2014-04-16 16:50:14 +02:00
Christophe Fergeau
db984941af Fix --without-sasl build
There are 2 SASL-related function prototypes which are unused in the
--without-sasl case. They cause a warning, and a build failure
when using -Werror. Wrapping them in #if HAVE_SASL avoids this issue.
2014-04-16 16:50:13 +02:00
Christophe Fergeau
37bf7a5163 doc: Generate chunked manual
This commit makes use of a2x in order to generate a chunked manual in
addition to the "all in one page" one.
2014-04-16 16:33:44 +02:00
Marc-André Lureau
b9bf654143 manual: improve text about ~/Public 2014-03-25 15:46:29 +01:00
Christophe Fergeau
1148c97d4b Check RSA_generate_key_ex return value
This can fail in fips mode for example. If we ignore the failure, we'll get
a crash:

 #0  0x00007f38d63728a0 in BN_num_bits () from /lib64/libcrypto.so.10
 #1  0x00007f38d639661d in RSA_size () from /lib64/libcrypto.so.10
 #2  0x00007f38d7991762 in reds_handle_read_link_done () from /lib64/libspice-server.so.1
 #3  0x00007f38d7990c06 in spice_server_add_client () from /lib64/libspice-server.so.1
 #4  0x00007f38d7990c6a in reds_accept () from /lib64/libspice-server.so.1
 #5  0x00007f38dc0d2946 in qemu_iohandler_poll (pollfds=0x7f38dedce200, ret=755449965, ret@entry=1) at iohandler.c:143
 #6  0x00007f38dc0d6ea8 in main_loop_wait (nonblocking=<optimized out>) at main-loop.c:465
 #7  0x00007f38dbffd7c0 in main_loop () at vl.c:1988
 #8  main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4357

This commit will cause the client connection to fail but qemu won't
segfault.
2014-03-20 11:45:20 +01:00
David Gibson
4019a8801d Don't truncate large 'now' values in _spice_timer_set
static void _spice_timer_set(SpiceTimer *timer, uint32_t ms, uint32_t now)

The _spice_timer_set() function takes a 32-bit integer for the "now" value.
The now value passed in however, can exceed 2^32 (it's in ms and derived
from CLOCK_MONOTONIC, which will wrap around a 32-bit integer in around 46
days).

If the now value passed in exceeds 2^32, this will mean timers are inserted
into the active list with expiry values before the current time, they will
immediately trigger, and (if they don't make themselves inactive) be
reinserted still before the current time.

This leads to an infinite loop in spice_timer_queue_cb().

https://bugzilla.redhat.com/show_bug.cgi?id=1072700
2014-03-20 11:34:49 +01:00
Marc-André Lureau
e411787df2 Update spice-common 2014-03-19 17:56:23 +01:00
Marc-André Lureau
fb72d198e3 manual: fix xml highlighting 2014-03-19 17:28:46 +01:00
Marc-André Lureau
06d646352e manual: add folder sharing section 2014-03-19 17:14:44 +01:00
Marc-André Lureau
2e730453bf Translate docbook -> asciidoc
It's much much easier to read and edit, and the end results looks better
as well, see http://elmarco.fedorapeople.org/manual.html
2014-03-19 17:14:44 +01:00
Marc-André Lureau
25f6745202 Associate org.spice-space.webdav.0 port to webdav channel
For example, with qemu, a webdav channel can be created this way:

 -chardev spiceport,name=org.spice-space.webdav.0,...

And redirected to a virtio port:

 -device virtserialport,...,name=org.spice-space.webdav.0
2014-03-19 17:14:44 +01:00
Marc-André Lureau
e044cfca1e build-sys: simplify manual html generation 2014-03-19 14:01:33 +01:00
Marc-André Lureau
f8bc446b76 SpiceUserManual.xml: small clean-ups
Remove some non-conventional/non-freesoftware editor-specific lines.

Remove trailing whitespaces

Get rid of DTD, which is too strict for docbook, see also:
http://docbook.org/tdg5/en/html/ch02.html

This get rids of the following warning/error:

I/O error : Attempt to load network entity
http://docbook.org/xml/5.0/dtd/docbook.dtd
/home/elmarco/src/spice/spice-master/docs/manual/SpiceUserManual.xml:4:
warning: failed to load external entity
"http://docbook.org/xml/5.0/dtd/docbook.dtd"
          "http://docbook.org/xml/5.0/dtd/docbook.dtd">
                                                       ^
2014-03-19 14:01:30 +01:00
Christophe Fergeau
660d63253d Fix test_capability() typo
It was spelt 'capabilty'
2014-03-13 17:13:38 +01:00
Christophe Fergeau
24e2e60a59 Fix typo in log message 2014-03-13 17:13:33 +01:00
Christophe Fergeau
67be56ad8a mjpeg: Don't warn on unsupported image formats
When trying to start mjpeg compression mode, mjpeg_encoder_start_frame()
tests the image format as its only able to compress 24/32bpp images. On
images with lower bit depths, we return MJPEG_ENCODER_FRAME_UNSUPPORTED to
indicate this is not a format we can compress. However, this return goes
with a spice_warning("unsupported format"). As the rest of the code can
cope with this unsupported format by not doing mjpeg compression, it's
nicer to downgrade this spice_warning() to spice_debug().

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1070028
2014-03-13 17:13:27 +01:00
Christophe Fergeau
7095563153 Add reference manual
This manual documents how to enable/use various SPICE features when
creating a VM by running QEMU directly, or when using libvirt, or when
using virt-manager.
This is based on work by Lubos Kocman
2014-01-20 12:18:15 +01:00
Christophe Fergeau
2ea58dd7a7 Make RedsStream::info private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
28fa3b1b3f Introduce reds_stream_set_channel() 2014-01-20 12:15:42 +01:00
Christophe Fergeau
82511418a0 Introduce reds_stream_set_info_flag() 2014-01-20 12:15:42 +01:00
Christophe Fergeau
25aca54f12 Make RedsStream::async_read private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
dc04c076ef Make RedsStream::sasl private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
284f9d0d7a Make RedsStream read/write functions private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
520ebdc815 Make RedsStream::ssl private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
30fecf87f8 Introduce reds_stream_is_ssl() 2014-01-20 12:15:42 +01:00
Christophe Fergeau
1f7123298f Add RedsStream::priv
The private data is allocated at the same time as RedsStream and
goes immediatly after the main RedsStream data.
This private member will allow to hide internal RedsStream
implementation details from the rest of spice-server.
2014-01-20 12:15:42 +01:00
Christophe Fergeau
7ff743c431 Move SASL authentication to reds_stream.h
SASL authentication mostly use members from RedsStream to do its work, so
it makes sense to have its code in reds_stream.c. This should allow to make
RedsStream::sasl private in the future.
2014-01-20 12:15:42 +01:00
Christophe Fergeau
9feed6940f Move async code to RedsStream
The AsyncRead structure in reds.h wraps an async read + callback to
be done on a stream. Moving it to reds_stream.h is needed in order
to move SASL authentication there.
2014-01-20 12:15:42 +01:00
Christophe Fergeau
cdaab7272c Move stream read/write callbacks to reds_stream.c
Now that stream creation and SSL enabling are done by helpers
in reds_stream.c, we can move the initialization of the vfunc
read/write pointers there too.
2014-01-20 12:15:41 +01:00
Christophe Fergeau
e0abf1adc2 Introduce reds_stream_new() helper
Initializing a new stream means initializing quite a few fields.
This commit factors this initialization in a dedicated reds_stream_new
helper. This also helps moving more code from reds.c to reds_stream.c
2014-01-20 12:15:41 +01:00
Christophe Fergeau
d533f72fe6 reds: Move SSL-related code to RedsStream
Code to initiate a SSL stream belongs there
2014-01-20 12:15:41 +01:00
Christophe Fergeau
e46743100f Move sync_write* to reds_stream.h
They are renamed to reds_stream_write*
2014-01-20 12:15:41 +01:00
Christophe Fergeau
8b347a641c Add reds_stream.[ch]
Gather common RedsStream code there rather than having it
in reds.c
2014-01-20 12:15:41 +01:00
Christophe Fergeau
73c56e5a2d Move SPICE_GNUC_VISIBLE to red_common.h 2014-01-20 12:15:41 +01:00
Christophe Fergeau
7d9018d441 tests: Avoid malloc failures
test-display-streaming is calling malloc() without checking its return
value. Coverity warns about this. This commit switches to g_malloc() to
sidestep this warning (g_malloc() never returns NULL but aborts instead).
2014-01-02 18:07:16 +01:00
Christophe Fergeau
3ac428b4b7 tests: Remove unused variables
coverity spotted some variables that were declared but not used in
server/tests
2014-01-02 18:06:08 +01:00
Jeremy White
530888ad90 Fix typo; sampel --> sample
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2014-01-02 12:39:04 +01:00
Jeremy White
ce9b714137 Add support for the Opus codec
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2014-01-02 12:36:59 +01:00