Commit Graph

19 Commits

Author SHA1 Message Date
Daniel P. Berrange
02d56750bd Remove trailing blank lines
Remove any blank lines at the end of all source files
2012-01-13 18:11:59 +02:00
Alon Levy
8e049ce3b0 server/red_worker: reuse dispatcher
This patch reuses Dispatcher in RedDispatcher. It adds two helpers
to red_worker to keep RedWorker opaque to the outside. The dispatcher is
abused in three places that use the underlying socket directly:
 once sending a READY after red_init completes
 once for each channel creation, replying with the RedChannel instance
  for cursor and display.

FDO Bugzilla: 42463

rfc->v1:
* move callbacks to red_worker.c including registration (Yonit)
* rename dispatcher to red_dispatcher in red_worker.c and red_dispatcher.c
* add accessor red_dispatcher_get_dispatcher
* s/dispatcher_handle_recv/dispatcher_handle_recv_read/ and change sig to
  just Dispatcher *dispatcher (was the SpiceCoreInterface one)
* remove SpiceCoreInterface parameter from dispatcher_init (Yonit)
* main_dispatcher needed it for channel_event so it has it in
  struct MainDispatcher
* add dispatcher_get_recv_fd for red_worker
2011-11-08 16:23:10 +02:00
Yonit Halperin
f84dfeb0aa server: registering RedChannel in reds, instead of Channel
Merging the functionality of reds::channel, into RedChannel.
In addition, cleanup and fix disconnection code: before this patch,
red_dispatcher_disconnect_display_client
could have been called from the red_worker thread
(and it must be called only from the io thread).

RedChannel holds only connected channel clients. RedClient holds all the
channel clients that were created till it is destroyed
(and then it destroys them as well).

Note: snd_channel still doesn't use red_channel, however it
creates dummy channel and channel clients, in order to register itself
in reds.

server/red_channel.c: a channel is connected if it holds at least one channel client

Previously I changed RedChannel to hold only connected channel clients and
RedClient, to hold all the channel clients as long as it is not destroyed.

usbredir: multichannel has not been tested, it just compiles.
2011-08-23 18:27:46 +03:00
Alon Levy
448ed75bd6 server: Add RedClient
That means RedClient tracks a ring of channels. Right now there will be only
a single client because of the disconnection mechanism - whenever a new
client comes we disconnect all existing clients. But this patch adds already
a ring of clients to reds.c (stored in RedServer).

There is a known problem handling many connections and disconnections at the
same time, trigerrable easily by the following script:

export NEW_DISPLAY=:3.0

Xephyr $NEW_DISPLAY -noreset &
for ((i = 0 ; i < 5; ++i)); do
    for ((j = 0 ; j < 10; ++j)); do
        DISPLAY=$NEW_DISPLAY c_win7x86_qxl_tests &
    done
    sleep 2;
done

I fixed a few of the problems resulting from this in the same patch. This
required already introducing a few other changes:
 * make sure all removal of channels happens in the main thread, for that
 two additional dispatcher calls are added to remove a specific channel
 client (RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT and
 RED_WORKER_MESSAGE_DISPLAY_DISCONNECT_CLIENT).
 * change some asserts in input channel.
 * make main channel disconnect not recursive
 * introduce disconnect call back to red_channel_create_parser

The remaining abort is from a double free in the main channel, still can't
find it (doesn't happen when running under valgrind - probably due to the
slowness resulting from that), but is easy to see when running under gdb.
2011-08-23 17:56:44 +03:00
Alon Levy
f124b87a40 server/red_worker: explicitly include unistd and errno 2011-08-23 17:01:14 +03:00
Alon Levy
2a4d97fb78 server: add QXLWorker.flush_surfaces_async for S3/S4 support
This does the following, all to remove any referenced memory on the pci bars:
    flush_all_qxl_commands(worker);
    flush_all_surfaces(worker);
    red_wait_outgoing_item((RedChannel *)worker->display_channel);
    red_wait_outgoing_item((RedChannel *)worker->cursor_channel);

The added api is specifically async, i.e. it calls async_complete
when done.
2011-07-20 16:00:19 +03:00
Alon Levy
096f49afbf server: add async io support
The new _ASYNC io's in qxl_dev listed at the end get six new api
functions, and an additional callback function "async_complete". When
the async version of a specific io is used, completion is notified by
calling async_complete, and no READY message is written or expected by
the dispatcher.

update_area has been changed to push QXLRects to the worker thread, where
the conversion to SpiceRect takes place.

A cookie has been added to each async call to QXLWorker, and is passed back via
async_complete.

Added api:

QXLWorker:
    update_area_async
    add_memslot_async
    destroy_surfaces_async
    destroy_primary_surface_async
    create_primary_surface_async
    destroy_surface_wait_async

QXLInterface:
    async_complete
2011-07-20 16:00:19 +03:00
Christophe Fergeau
f88dc6eecb server: use gcc builtin for atomic get/set bit 2011-05-03 14:44:11 +02:00
Yonit Halperin
4b9304d54a server: enabling/disabling jpeg and zlib-over-glz via spice command line args 2010-07-12 14:16:31 +03:00
Alexander Larsson
d69b0829a6 RedWorkeMessage -> RedWorkerMessage 2010-05-21 10:56:05 +02:00
Gerd Hoffmann
20da2f162a replace worker load/save with loadvm_commands, allow keeping surface content
Add worker->loadvm_commands.  qemu will uses this to send a series of
commands needed to restore state after savevm/loadvm and migration.
That will be one create-surface command per surface and one cursor-set
command for the local pointer.

The worker->save/load functions are not needed any more.
Likewise the interface->{get,set}_save_data callbacks.

Surfaces created via loadvm_commands *will* not be cleared.  Also
primary surfaces are not cleared any more (unconditionally, although
we could do that conditionally on loadvm using the flags field in
QXLSurfaceCreate).
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
d3735feea6 QXL: redesign. 2010-05-19 11:22: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
c97116aeb9 Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
Izik Eidus
4a208b3644 libspice: add off screens support
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-03 05:35:31 +03:00
Gerd Hoffmann
505f7d8832 new libspice api: make image_compression_t part of the public api. 2010-03-09 14:29:51 +01:00
Izik Eidus
2ba69f9f88 libspice: add surface 0 support
This include alot of infestracture for off screens.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-01-28 04:46:29 +02:00
Izik Eidus
a70110c4e5 spice: server: add memslots support.
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2009-11-23 20:54:11 +02:00
Yaniv Kamay
c1b79eb035 fresh start 2009-10-14 15:06:41 +02:00