Commit Graph

60 Commits

Author SHA1 Message Date
Hans de Goede
55ebd0a1c0 Release 0.12.2 2012-12-20 20:39:54 +01:00
Christophe Fergeau
55495a61bf build: Use glib2
Now that QEMU depends on glib, it won't really hurt if we depend
on it as well, and we won't have to reinvent our own helpers.
2012-12-12 18:15:48 +01:00
Alon Levy
4e7d25a7ac Revert "server: add websockets support via libwebsockets"
This reverts commit 63bb37276e.
2012-11-04 13:48:42 +02:00
Alon Levy
63bb37276e server: add websockets support via libwebsockets
New API: spice_server_set_ws_ports

This adds an optional dependency on libwebsockets. You need to get my
patched 0.0.3 version here:
 git://people.freedesktop.org/~alon/libwebsockets

There is no qemu patches yet, to test change in reds.c the default value
of spice_ws_port to 5959 (for the default of spice-html5).

For testing there is an online client at
 http://spice-space.org/spice-html5/spice.html

Known issues:
 1. The tester (server/tests/test_display_no_ssl) gets into dropping all
  data after a few seconds, I think it's an issue with the implemented
  watches, but haven't figured it out.

 2. libwebsocket's read interface is inverted to what our code expects,
 i.e. there is no libwebsocket_read, so there is an additional copy
 involved (see RedsWebSocket). This can be fixed.

 3. Listening on a separate port. Since the headers are different, we
 could listen on the same port (first three bytes RED/GET). I don't know
 if we want to?

Todos:
 1. SSL not implemented yet. Needs some thought as to how.

 2. Serve spice-html5 when accessed as a http server. Nice to have.
2012-10-25 12:33:02 +02:00
Alon Levy
c48812ee51 server/Makefile.am: fix for make distcheck
Doesn't make sense to distribute test_spice_version.sh, so just
ensure the build passes if it doesn't exist.
2012-09-13 16:38:58 +03:00
Alon Levy
078742b0ee server: add dist-hook to prevent spice version configure/spice.h difference 2012-09-03 10:31:02 +03:00
Yonit Halperin
70f820ded2 seamless-migration: add migration_protocol.h
The file will hold the declarations of the different migration
data messages (depending on the channel), that will be passed
from the src server to the dst server, via the client, using
SPICE_MSG_MIGRATE_DATA.
2012-08-27 09:04:52 +03:00
Yonit Halperin
50e3af6a99 char_device: Introducing shared flow control code for char devices.
SpiceCharDeviceState manages the (1) write-to-device queue
(2) wakeup and reading from the device (3) client tokens (4)
sending messages from the device to the client/s, considering the
available tokens.
SpiceCharDeviceState can be also stopped and started. When the device
is stopped, no reading or writing is done from/to the device. Messages
addressed from the client to the device are being queued.
Later, an api for stop/start will be added to spice.h and it should
be called from qemu.

This patch does not yet remove the wakeup callback from
SpiceCharDeviceState, but once all the char devices (agent/spicevmc/smartcard)
code will switch to the new implementation, SpiceCharDeviceState
will be moved to the c file and its reference to the wakeup callback will be removed.
2012-07-03 14:13:41 +03:00
Alon Levy
5cbffe794f Release 0.11.0
Current bumped and age bumped for new intefaces only (no backward
incompatible changes).

New libtool version is 2.0.1, using --version-info instead of
--version-name. Doing the version change and --version-name to
--version-info change here to avoid changing the libtool version twice.

Added interfaces:
    spice_server_set_name
    spice_server_set_uuid
    spice_server_set_listen_socket_fd
    spice_server_is_server_mouse

New library name in linux:
    libspice-server.so.1.1.0
Old:
    libspice-server.so.1.0.2
2012-06-12 17:55:28 +03:00
Marc-André Lureau
359fc1cb5d Use the spice-common submodule
This patch will replace the common/ directory with the spice-common
project. It is for now a simple project subdirectory shared with
spice-gtk, but the goal is to make it a proper library later on.

With this change, the spice-server build is broken. The following
commits fix the build, and have been seperated to ease the review.

v2
- moves all the generated marshallers to spice-common library
- don't attempt to fix windows VS build, which should somehow be
  splitted with spice-common (or built from tarball only to avoid
  generation tools/libs deps)
v3
- uses libspice-common-client
- fix a mutex.h inclusion reported by Alon
2012-03-25 18:59:10 +02:00
Dan McGee
0e3ff74b84 Add configure-time check for -Wl, --version-script option
This is supported by the GNU linker, but not the Solaris linker, which
is used as the default on that platform even when compiling with GCC.
Omit passing the option to the linker on platforms that do not support
it.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-02-21 10:20:44 +02:00
Jürg Billeter
dedaa9ac39 server: Move $(Z_LIBS) from INCLUDES to LIBADD in Makefile.am
This fixes undefined references to deflate* when building tests.

Signed-off-by: Jürg Billeter <j@bitron.ch>
2011-11-28 11:05:49 +01:00
Alon Levy
776bdd6c95 server: introduce dispatcher
used for main_dispatcher only in this patch.

Dispatcher is meant to be used for Main<->any low frequency messages.

It's interface is meant to include the red_dispatcher usage:
 fixed size messages per message type
 some messages require an ack

Some methods are added to be used by RedDispatcher later:
 dispatcher_handle_read - to be called directly by RedDispatcher epoll
  based loop
 dispatcher_set_opaque - to be set from red_worker pthread
 dispatcher_init - allow NULL core as used by red_worker

Read and Write behavior:
 Sender: blocking write, blocking read for ack (if any).
 Reader: poll for any data, if such then blocking read for a
 message_type and following message. repeat until poll returns
 with no pending data to read.

FDO Bugzilla: 42463
2011-11-08 14:59:49 +02:00
Alon Levy
bd8771adbc [0.8 branch] server: add main_dispatcher
add main_dispatcher, a message passing mechanism for sending messages to
the main thread. The main thread is the thread that implements
SpiceCoreInterface, which is assumed to be a single thread.

Similar to the async operation of red_worker, a socket pair is created
and used to pass messages. The messages are a fixed size to ease
parsing. A single message is defined to pass a channel_event.

RHBZ: 746950
FDBZ: 41858

This patch is 0.8 branch only, for the master branch there should be a
better approach to share code with red_dispatcher and ready the way for
later adding more threads.

cherry-pick from 0.8 80caf07e09

Conflicts:

	server/reds.c
2011-10-31 17:35:54 +02:00
Hans de Goede
c030382abb Rename usbredir channel code to spicevmc
While discussing various things with Alon in Vancouver, it came up that
having a channel which simply passes through data coming out of a qemu
chardev frontend unmodified, like the usbredir channel does, can be used
for a lot of other cases too. To facilitate this the usbredir channel code
will be turned into a generic spicevmc channel, which is just a passthrough
to the client, from the spicevmc chardev.

This patch renames usbredir.c to spicevmc.c and changes the prefix of all
functions / structs to match. This should make clear that the code is not
usbredir specific.

Some examples of why having a generic spicevmc pass through is good:
1) We could add a monitor channel, allowing access to the qemu monitor from
the spice client, since the monitor is a chardev frontend we could re-use
the generic spicevmc channel server code, so all that is needed to add this
(server side) would be reserving a new channel id for this.

2) We could allow users to come up with new channels of their own, without
requiring qemu or server modification. The idea is to allow doing something
like this on the qemu startup cmdline:
-chardev spicevmc,name=generic,channelid=128

To ensure these new "generic" channels cannot conflict with newly added
official types, they must start at the SPICE_CHANNEL_USER_DEFINED_START value
(128).

These new user defined channels could then either be used with a special
modified client, with client plugins (if we add support for those), or
by exporting them on the client side for use by an external ap, see below.

3) We could also add support to the client to make user-defined channels
end in a unix socket / pipe, allowing handling of the data by an external app,
we could for example have a new spice client cmdline argument like this:
--custom-channel unixsocket=/tmp/mysocket,channelid=128

This would allow for something like:
$random app on guest -> virtio-serial -> spicevmc chardev ->
 -> spicevmc channel -> unix socket -> $random app on client

4) On hind sight this could also have been used for the smartcard stuff,
with a 1 channel / reader model, rather then the current multiplexing code
where we've our own multiplexing protocol wrapper over the libcacard
smartcard protocol.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-08-25 14:04:27 +02:00
Hans de Goede
c5a291f454 server: Add a usbredir channel 2011-08-10 22:42:40 +02:00
Christophe Fergeau
e0e8d091ff fix make distcheck 2011-07-22 10:24:30 +02:00
Gerd Hoffmann
7013561462 server: add symbol versioning to the spice server shared library.
This patch adds symbol versions to the spice server library.  Each
symbol which is exported by libspice-server gets tagged with the
(stable) version where it appeared first.  This way the linker and rpm
are able to figure which version of the spice-server libary is required
by a particular qemu binary/package.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-19 14:39:28 +02:00
Marc-André Lureau
aae0357023 build: require c99
Because we use c99: stdbool.h, inttypes.h, bool, variadic macros, // comments, ...
2011-05-03 16:49:43 +02:00
Christophe Fergeau
2db7212175 autotools: correctly build canvas-related code
spice client and spice server shares code from
common/{gdi,gl,sw}_canvas.[ch]. However, while most of the code is
shared, the server code wants a canvas compiled with
SW_CANVAS_IMAGE_CACHE defined while the client code wants a canvas
compiled with SW_CANVAS_CACHE.

The initial autotools refactoring didn't take that into account,
this is now fixed by this commit. After this commit, the canvas
files from common/ are no longer compiled as part of the
libspice-common.la convenience library. Instead, there are "proxy"
canvas source files in client/ and server/ which #include the
appropriate C files after defining the relevant #define for the
binary that is being built.

To prevent misuse of the canvas c files and headers in common/,
SPICE_CANVAS_INTERNAL must be set when including the canvas headers
from common/ or when building the c files from common/ otherwise
the build will error out.
2011-05-03 14:44:10 +02:00
Christophe Fergeau
2a4614ea94 autotools: refactor the whole build machinery
spice Makefile.am setup is a bit confusing, with source file
names being listed several times in different Makefile.am
(generally, once in EXTRA_DIST and another time in another
Makefile.am in _SOURCES). The client binaries are built
by client/x11/Makefile.am, which means recursing into client,
then into x11 to finally build spicec. This Makefile.am is
also referencing files from common/ and client/, which is
a bit unusual with autotools.

This patch attempts to simplify the build process to get
something more usual from an autotools point of view.
The source from common/ are compiled into a libtool convenience
library, which the server and the client links against which avoids
referencing source files from common/ when building the server and
the client. The client is built in client/Makefile.am and directly
builds files from x11/ windows/ and gui/ if needed (without
recursing in these subdirectories).

This makes the build simpler to understand, and also makes it
possible to list source files once, which avoids potential
make distcheck breakage when adding new files.

There is a regression in this patch with respect to
sw_canvas/gl_canvas/gdi_canvas. They should be built with
different preprocessor #defines resulting in different behaviour
of the canvas for the client and the server. However, this is not
currently the case, both the client and the server will use the same
code for now (which probably means one of them is broken). This will
be fixed in a subsequent commit.

make distcheck passes, but compilation on windows using the
autotools build system hasn't been tested, which means it's likely
to be broken. It shouldn't be too hard ot fix it though, just let
me know of any issues with this.
2011-05-03 14:44:10 +02:00
Hans de Goede
c2db6d1066 spice-server: Add the ability to filter agent messages 2011-03-24 17:28:21 +01:00
Alon Levy
43c5b4f973 server: use -std=c99
Finds some bugs.
2011-03-22 09:44:52 +02:00
Marc-André Lureau
414e1de720 build: add --with-sasl
Using cyrus SASL library (same as gtk-vnc/qemu).

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
0e64e2d02c build: make it silent
This patch make it easier to spot warnings in compilation.  It should
work with older versions of automake that don't support silent rules.

If you want verbose build, make V=1.

Signed-off-by: Uri Lublin <uril@redhat.com>

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 16:55:22 +01:00
Alon Levy
685f82a48e server: split main_channel from reds 2011-01-13 06:56:51 +02:00
Alon Levy
347e32177c server: introduce inputs_channel, split from reds.c 2010-12-07 21:32:33 +02:00
Alon Levy
7e0a1dfa75 smartcard: configure option --enable-smartcard 2010-12-07 13:31:44 +02:00
Alon Levy
3eac546309 server: add char_device.h to Makefile.am for make dist 2010-12-02 17:17:11 +02:00
Alon Levy
0ede43e893 server: tests: add basic tests with working do nothing server 2010-11-08 16:04:27 +02:00
Alexander Larsson
ceff16cad6 Make distcheck work 2010-07-08 20:20:35 +02:00
Alexander Larsson
1a6e77d6d4 Fix various misspellings
letancy -> latency
compund -> compound
SpicedSubMessage -> SpiceSubMessage
modifaiers -> modifiers
massage -> message
outgoiong -> outgoing
AlphaBlnd -> AlphaBlend
remoth -> remote
modifires -> modifiers
secore -> secure
2010-07-08 18:26:37 +02:00
Alexander Larsson
a24a8ff72a Store SpicePath segment count rather than size
Internally and in the network protocol (for the new version) we
now store the actual number of segments rather than the size of the
full segments array in bytes. This change consists of multiple changes
to handle this:

* Make the qxl parser calculate num_segments
* Make the canvas stroke code handle the new SpicePath layout.
* Fix up is_equal_path in red_worker.c for the new layout
* replace multiple calls to spice_marshall_PathSegment with a single
  spice_marshall_Path call
* Make the byte_size() array size handling do the conversion from
  network size to number of elements when marshalling/demarshalling.
* Update the current spice protocol to send the segment count rather than
  the size
* Update the old spice protocol to use the new byte_size functionallity
  to calculate the size sent and the number of elements recieved
2010-06-30 22:35:17 +02:00
Alexander Larsson
7627fba05d server: Don't call opengl if not enabled
If USE_OGL is not defined, really don't call or link in the opengl
backend.
2010-06-29 18:32:20 +02:00
Gerd Hoffmann
11034dda42 qxl abi: parse QXLDrawable. 2010-06-29 12:30:19 +02:00
Alexander Larsson
7e26ff3c26 Replace log4cpp with custom log function
Also prints a simpler error to stderr for WARN or above so that
we print something on the commandline if something go wrong.
2010-06-28 21:54:53 +02:00
Yonit Halperin
25bb38f643 applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
Alexander Larsson
4c1094acce Make all message structs internal to spice
We move all message structs from spice-protocol to spice as
we want to be able to change these as needed internally. The
on-network format is no longer defined by these structures anyway,
but rather by the spice protocol description.
2010-06-18 20:27:32 +02:00
Alexander Larsson
ec10a1662f Generate demarshallers on server side 2010-06-18 20:27:32 +02:00
Alexander Larsson
e2728082d0 Generate marshallers in server 2010-06-18 20:27:27 +02:00
Alexander Larsson
0cca1ed2af Add SpiceMarshaller for easy marshalling 2010-06-18 16:32:11 +02:00
Yonit Halperin
263646a1f7 JPEG support: introducing jpeg encoding for spice bitmaps 2010-06-09 11:40:25 +02:00
Alexander Larsson
2f10d6db46 Add missing backslash continuation in makefile 2010-05-19 12:30:00 +02:00
Gerd Hoffmann
9204a5903a add spice-experimental.h
Supposed to be used for work-in-progress bits,
where interfaces are not finalized yet.

Moved over vdi port interface, tunnel interface
and spice client migration functions.
2010-05-19 11:22:08 +02:00
Gerd Hoffmann
981abd3fee zap vd_interface.h
move over content to spice.h
2010-05-19 11:22:07 +02:00
Alexander Larsson
25bca7a286 Minor whitespace cleanup 2010-05-19 11:13:47 +02:00
Alexander Larsson
ee1e60c4a0 Make it --enable-tunnel work 2010-05-19 11:13:06 +02:00
Alexander Larsson
ae40f270cf Remove all mentions of "cairo" from the code
The command line option is renamed from "cairo" to "sw", and
similarly all filenames and types from Cairo to Sw (and similar).
2010-05-03 12:38:02 +02:00
Alexander Larsson
34fb3f6806 Split out the memslot stuff from red_worker.c to its own files
This is required so that we can have code in other files that does address
validation.
2010-04-09 16:51:52 +02:00
Alexander Larsson
de4306af33 Initialize _kill_mark so we don't get spurious valgrind warnings 2010-04-08 17:09:32 +02:00