[Spice-commits] Branch '0.10' - 17 commits - .gitignore NEWS client/.gitignore client/foreign_menu.cpp client/gui client/x11 common/.gitignore configure.ac docs/Spice_for_newbies.odt docs/Spice_protocol.odt docs/Spice_style.odt docs/Spice_user_manual.odt docs/Vd_interfaces.odt server/inputs_channel.c server/main_channel.c server/red_channel.c server/red_tunnel_worker.c server/red_worker.c server/reds.c server/snd_worker.c server/spice.h server/spicevmc.c server/tests
Hans de Goede
jwrdegoede at kemper.freedesktop.org
Mon Jan 23 07:25:50 PST 2012
.gitignore | 2
NEWS | 8 +++
client/.gitignore | 1
client/foreign_menu.cpp | 2
client/gui/softrenderer.cpp | 2
client/x11/.gitignore | 1
client/x11/event_sources_p.cpp | 2
client/x11/named_pipe.cpp | 1
client/x11/platform.cpp | 13 ++---
client/x11/red_window.cpp | 2
common/.gitignore | 1
configure.ac | 5 +-
docs/Spice_for_newbies.odt |binary
docs/Spice_protocol.odt |binary
docs/Spice_style.odt |binary
docs/Spice_user_manual.odt |binary
docs/Vd_interfaces.odt |binary
server/inputs_channel.c | 9 ---
server/main_channel.c | 23 ++++-----
server/red_channel.c | 6 ++
server/red_tunnel_worker.c | 4 +
server/red_worker.c | 92 ++++++++++++++++++++++++--------------
server/reds.c | 4 +
server/snd_worker.c | 16 +++++-
server/spice.h | 2
server/spicevmc.c | 6 +-
server/tests/.gitignore | 2
server/tests/test_empty_success.c | 2
28 files changed, 133 insertions(+), 73 deletions(-)
New commits:
commit 2f4115e52eeea3039a9e230d8c79ab42691a7dbf
Merge: c055234... 8817549...
Author: Hans de Goede <hdegoede at redhat.com>
Date: Mon Jan 23 16:21:14 2012 +0100
Merge remote-tracking branch 'origin/master' into 0.10
commit 8817549795722026ca83edab2640b8f156510074
Author: Hans de Goede <hdegoede at redhat.com>
Date: Mon Jan 23 15:23:44 2012 +0100
Release 0.10.1
diff --git a/NEWS b/NEWS
index 83765f1..2deba57 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+Major changes in 0.10.1:
+========================
+* Mini header support
+* Add server API for injecting a client connection socket
+* Add Xinerama support to spicec
+* Many bugfixes / code cleanups
+* Requires spice-protocol >= 0.10.1
+
Major changes in 0.10.0:
========================
* 32 bit (little endian) server builds.
diff --git a/configure.ac b/configure.ac
index b6fb751..0f8ad7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.57])
m4_define([SPICE_MAJOR], 0)
m4_define([SPICE_MINOR], 10)
-m4_define([SPICE_MICRO], 0)
+m4_define([SPICE_MICRO], 1)
AC_INIT(spice, [SPICE_MAJOR.SPICE_MINOR.SPICE_MICRO], [], spice)
diff --git a/server/spice.h b/server/spice.h
index 6233a6c..c582e6c 100644
--- a/server/spice.h
+++ b/server/spice.h
@@ -22,7 +22,7 @@
#include <sys/socket.h>
#include <spice/qxl_dev.h>
-#define SPICE_SERVER_VERSION 0x000901 /* release 0.9.1 */
+#define SPICE_SERVER_VERSION 0x000a01 /* release 0.10.1 */
/* interface base type */
commit a0190fce2302b8051f744c5cf38c1b334d77d11e
Author: Hans de Goede <hdegoede at redhat.com>
Date: Mon Jan 23 15:49:22 2012 +0100
Fix various comparison between signed and unsigned integer expressions warnings
These turn into errors because of our -Werror use, breaking the build.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
diff --git a/client/gui/softrenderer.cpp b/client/gui/softrenderer.cpp
index 9f19e7b..c888bc0 100644
--- a/client/gui/softrenderer.cpp
+++ b/client/gui/softrenderer.cpp
@@ -45,7 +45,7 @@ SoftRenderer::SoftRenderer(uint8_t* surface, uint width, uint height, uint strid
, _image_codec_module (NULL)
, _queueing(true)
{
- assert(stride == _width * 4); //for now
+ assert(stride == width * 4); //for now
if (!_image_codec) {
setupImageCodec();
}
diff --git a/client/x11/event_sources_p.cpp b/client/x11/event_sources_p.cpp
index 1958a04..5f9f452 100644
--- a/client/x11/event_sources_p.cpp
+++ b/client/x11/event_sources_p.cpp
@@ -119,7 +119,7 @@ bool EventSources::wait_events(int timeout_msec)
return false;
}
- for (int i = 0; i < _events.size(); i++) {
+ for (unsigned int i = 0; i < _events.size(); i++) {
if (FD_ISSET(_fds[i], &rfds)) {
_events[i]->action();
/* The action may have removed / added event sources changing
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 416513e..f535d6d 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -135,7 +135,7 @@ static struct clipboard_format_info clipboard_formats[] = {
{ VD_AGENT_CLIPBOARD_IMAGE_JPG, { "image/jpeg", NULL }, },
};
-#define clipboard_format_count (sizeof(clipboard_formats)/sizeof(clipboard_formats[0]))
+#define clipboard_format_count ((int)(sizeof(clipboard_formats)/sizeof(clipboard_formats[0])))
struct selection_request {
XEvent event;
@@ -145,11 +145,11 @@ struct selection_request {
static int expected_targets_notifies = 0;
static bool waiting_for_property_notify = false;
static uint8_t* clipboard_data = NULL;
-static int32_t clipboard_data_size = 0;
-static int32_t clipboard_data_space = 0;
+static uint32_t clipboard_data_size = 0;
+static uint32_t clipboard_data_space = 0;
static Atom clipboard_request_target = None;
static selection_request *next_selection_request = NULL;
-static uint32_t clipboard_type_count = 0;
+static int clipboard_type_count = 0;
static uint32_t clipboard_agent_types[256];
static Atom clipboard_x11_targets[256];
static Mutex clipboard_lock;
@@ -1242,7 +1242,7 @@ private:
void update_position();
bool find_mode_in_outputs(RRMode mode, int start_index, XRRScreenResources* res);
bool find_mode_in_clones(RRMode mode, XRRScreenResources* res);
- XRRModeInfo* find_mode(int width, int height, XRRScreenResources* res);
+ XRRModeInfo* find_mode(unsigned int width, unsigned int height, XRRScreenResources* res);
private:
MultyMonScreen& _container;
@@ -2181,7 +2181,7 @@ public:
}
};
-XRRModeInfo* XMonitor::find_mode(int width, int height, XRRScreenResources* res)
+XRRModeInfo* XMonitor::find_mode(unsigned int width, unsigned int height, XRRScreenResources* res)
{
typedef std::set<ModeInfo, ModeCompare> ModesSet;
ModesSet modes_set;
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index e0b7d45..b16249e 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -922,7 +922,7 @@ void RedWindow_p::win_proc(XEvent& event)
case ClientMessage:
if (event.xclient.message_type == wm_protocol_atom) {
ASSERT(event.xclient.format == 32);
- if (event.xclient.data.l[0] == wm_delete_window_atom) {
+ if ((Atom)event.xclient.data.l[0] == wm_delete_window_atom) {
DBG(0, "wm_delete_window");
Platform::send_quit_request();
}
commit 459a4dba56bad9dbfb529723eee063c138baccce
Author: Alon Levy <alevy at redhat.com>
Date: Mon Jan 23 12:58:30 2012 +0200
server/red_channel: red_peer_handle_incoming: comment on null check
Signed-off-by: Alon Levy <alevy at redhat.com>
diff --git a/server/red_channel.c b/server/red_channel.c
index d2c9e6d..ec02018 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -162,6 +162,8 @@ static void red_peer_handle_incoming(RedsStream *stream, IncomingHandler *handle
uint16_t msg_type;
uint32_t msg_size;
+ /* XXX: This needs further investigation as to the underlying cause, it happened
+ * after spicec disconnect (but not with spice-gtk) repeatedly. */
if (!stream) {
return;
}
commit 51d7598a2e589e88a818c0e1973baf12143e4263
Author: Alon Levy <alevy at redhat.com>
Date: Mon Jan 23 12:31:30 2012 +0200
server/tests/test_empty_success: fix warning on bzero
Signed-off-by: Alon Levy <alevy at redhat.com>
diff --git a/server/tests/test_empty_success.c b/server/tests/test_empty_success.c
index fb46aa8..435efbf 100644
--- a/server/tests/test_empty_success.c
+++ b/server/tests/test_empty_success.c
@@ -1,5 +1,7 @@
#include <config.h>
#include <stdlib.h>
+#include <strings.h>
+
#include <spice.h>
SpiceTimer* timer_add(SpiceTimerFunc func, void *opaque)
commit 07b8d85cb626134d6a2cbcd9f8d0411afdeedaf4
Author: Dan McGee <dpmcgee at gmail.com>
Date: Thu Jan 19 14:10:04 2012 -0600
Use found python binary to check for pyparsing
This matches what we do in client/Makefile.am to actually run the
python scripts, which is to use the python binary we find first,
preferring 'python2' over 'python'. This makes the compile work on odd
systems such as Arch Linux where the python binary is actually python3.
Signed-off-by: Dan McGee <dpmcgee at gmail.com>
diff --git a/configure.ac b/configure.ac
index da60017..b6fb751 100644
--- a/configure.ac
+++ b/configure.ac
@@ -217,7 +217,7 @@ SPICE_REQUIRES+=" celt051 >= 0.5.1.1"
if test ! -e client/generated_marshallers.cpp; then
AC_MSG_CHECKING([for pyparsing python module])
-echo "import pyparsing" | python - >/dev/null 2>&1
+echo "import pyparsing" | ${PYTHON} - >/dev/null 2>&1
if test $? -ne 0 ; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([pyparsing python module is required to compile this package])
@@ -531,6 +531,7 @@ echo "
prefix: ${prefix}
c compiler: ${CC}
c++ compiler: ${CXX}
+ python: ${PYTHON}
Build Spice client: ${enable_client}
commit 90d612686901254ec0d600ea991e65dbdc849ce5
Author: Dan McGee <dpmcgee at gmail.com>
Date: Thu Jan 19 14:10:03 2012 -0600
Remove epoll headers from client code
There is no more usage of epoll on the client side, so no need to
include these header files.
Signed-off-by: Dan McGee <dpmcgee at gmail.com>
diff --git a/client/x11/named_pipe.cpp b/client/x11/named_pipe.cpp
index 84b980d..ad6b2e5 100644
--- a/client/x11/named_pipe.cpp
+++ b/client/x11/named_pipe.cpp
@@ -20,7 +20,6 @@
#include <sys/types.h>
#include <sys/socket.h>
-#include <sys/epoll.h>
#include <sys/un.h>
#include "named_pipe.h"
#include "utils.h"
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index df8fa76..416513e 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -34,7 +34,6 @@
#include <X11/extensions/Xfixes.h>
#include <unistd.h>
#include <sys/socket.h>
-#include <sys/epoll.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/syscall.h>
commit 781706ea0de422b95112f064c37f69ec4715a87b
Author: Nahum Shalman <nshalman-github at elys.com>
Date: Thu Jan 19 14:10:02 2012 -0600
server: don't complain if setsockopt(SO_PRIORITY) call fails
dc7855967f4e did this for the TCP_NODELAY and IP_TOS calls; we should do
it for priority as well if necessary.
We also #ifdef the setting of the low-level socket priority based on
whether we have a definition of SO_PRIORITY available. This option is
not available on Illumos/Solaris platforms; however, since we set IP_TOS
anyway it is not a big deal to omit it here.
diff --git a/server/snd_worker.c b/server/snd_worker.c
index cb64c99..e78d1d3 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -902,7 +902,9 @@ static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_i
SndChannel *channel;
int delay_val;
int flags;
+#ifdef SO_PRIORITY
int priority;
+#endif
int tos;
MainChannelClient *mcc = red_client_get_main(client);
@@ -911,11 +913,15 @@ static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_i
goto error1;
}
+#ifdef SO_PRIORITY
priority = 6;
if (setsockopt(stream->socket, SOL_SOCKET, SO_PRIORITY, (void*)&priority,
sizeof(priority)) == -1) {
- red_printf("setsockopt failed, %s", strerror(errno));
+ if (errno != ENOTSUP) {
+ red_printf("setsockopt failed, %s", strerror(errno));
+ }
}
+#endif
tos = IPTOS_LOWDELAY;
if (setsockopt(stream->socket, IPPROTO_IP, IP_TOS, (void*)&tos, sizeof(tos)) == -1) {
commit 89cc196a1b6b93d702ed456cd003d12ae304f9cf
Author: Dan McGee <dpmcgee at gmail.com>
Date: Thu Jan 19 14:10:01 2012 -0600
server/inputs_channel: don't set O_ASYNC option on socket
output to send a SIGIO signal to the running program. However, we don't
handle this signal anywhere in the code, so setting the option is
unnecessary.
Signed-off-by: Dan McGee <dpmcgee at gmail.com>
diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index 83c2cad..a3f26c0 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -282,7 +282,8 @@ static void inputs_channel_send_item(RedChannelClient *rcc, PipeItem *base)
red_channel_client_begin_send_message(rcc);
}
-static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint16_t type, void *message)
+static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint16_t type,
+ void *message)
{
InputsChannel *inputs_channel = (InputsChannel *)rcc->channel;
InputsChannelClient *icc = (InputsChannelClient *)rcc;
@@ -464,7 +465,6 @@ static void inputs_pipe_add_init(RedChannelClient *rcc)
static int inputs_channel_config_socket(RedChannelClient *rcc)
{
- int flags;
int delay_val = 1;
RedsStream *stream = red_channel_client_get_stream(rcc);
@@ -476,11 +476,6 @@ static int inputs_channel_config_socket(RedChannelClient *rcc)
}
}
- if ((flags = fcntl(stream->socket, F_GETFL)) == -1 ||
- fcntl(stream->socket, F_SETFL, flags | O_ASYNC) == -1) {
- red_printf("fcntl failed, %s", strerror(errno));
- return FALSE;
- }
return TRUE;
}
commit b0b19f4b2580977f594cabe03c58b0fa75dd7bda
Author: Dan McGee <dpmcgee at gmail.com>
Date: Thu Jan 19 14:10:00 2012 -0600
Update .gitignore with a few more generated files
Signed-off-by: Dan McGee <dpmcgee at gmail.com>
diff --git a/.gitignore b/.gitignore
index 5a4db5c..6c15c13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,7 +17,9 @@ depcomp
install-sh
libtool
ltmain.sh
+m4/
missing
Makefile
Makefile.in
+spice-server.pc
stamp-h1
diff --git a/client/.gitignore b/client/.gitignore
index 39a4cf7..0561c05 100644
--- a/client/.gitignore
+++ b/client/.gitignore
@@ -10,3 +10,4 @@ generated_demarshallers.cpp
generated_demarshallers1.cpp
generated_marshallers.cpp
generated_marshallers1.cpp
+spicec
diff --git a/client/x11/.gitignore b/client/x11/.gitignore
index 397a68f..2f08d7e 100644
--- a/client/x11/.gitignore
+++ b/client/x11/.gitignore
@@ -3,6 +3,7 @@
*.loT
*.o
.deps
+.dirstamp
.libs
Makefile
Makefile.in
diff --git a/common/.gitignore b/common/.gitignore
index 07491dd..d033f47 100644
--- a/common/.gitignore
+++ b/common/.gitignore
@@ -3,6 +3,7 @@
*.loT
*.o
.deps
+.dirstamp
.libs
Makefile
Makefile.in
diff --git a/server/tests/.gitignore b/server/tests/.gitignore
index 063083b..d587e25 100644
--- a/server/tests/.gitignore
+++ b/server/tests/.gitignore
@@ -1,4 +1,6 @@
test_display_no_ssl
+test_display_streaming
test_empty_success
test_just_sockets_no_ssl
test_fail_on_null_core_interface
+test_playback
commit c4ddc5ba51579f9139e4c7da31ce6b3fe0878f9c
Author: Dan McGee <dpmcgee at gmail.com>
Date: Thu Jan 19 14:09:59 2012 -0600
Fix git commit hook errors in red_worker
This ensures all line lengths are down below 100 characters as well as
removing some trailing spaces.
Signed-off-by: Dan McGee <dpmcgee at gmail.com>
diff --git a/server/red_worker.c b/server/red_worker.c
index c2ab957..80fa825 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1043,14 +1043,17 @@ static void dump_bitmap(RedWorker *worker, SpiceBitmap *bitmap, uint32_t group_i
#define DCC_FOREACH(link, dcc, channel) \
for (link = channel ? ring_get_head(&(channel)->clients) : NULL,\
- dcc = link ? SPICE_CONTAINEROF((link), DisplayChannelClient, common.base.channel_link) : NULL;\
+ dcc = link ? SPICE_CONTAINEROF((link), DisplayChannelClient,\
+ common.base.channel_link) : NULL;\
(link); \
(link) = ring_next(&(channel)->clients, link),\
dcc = SPICE_CONTAINEROF((link), DisplayChannelClient, common.base.channel_link))
#define WORKER_FOREACH_DCC(worker, link, dcc) \
- for (link = ((worker) && (worker)->display_channel) ? ring_get_head(&(worker)->display_channel->common.base.clients) : NULL,\
- dcc = link ? SPICE_CONTAINEROF((link), DisplayChannelClient, common.base.channel_link) : NULL;\
+ for (link = ((worker) && (worker)->display_channel) ?\
+ ring_get_head(&(worker)->display_channel->common.base.clients) : NULL,\
+ dcc = link ? SPICE_CONTAINEROF((link), DisplayChannelClient,\
+ common.base.channel_link) : NULL;\
(link); \
(link) = ring_next(&(worker)->display_channel->common.base.clients, link),\
dcc = SPICE_CONTAINEROF((link), DisplayChannelClient, common.base.channel_link))
@@ -1090,7 +1093,8 @@ static void dump_bitmap(RedWorker *worker, SpiceBitmap *bitmap, uint32_t group_i
// TODO: replace with DCC_FOREACH when it is introduced
#define WORKER_TO_DCC(worker) \
- (worker->display_channel ? SPICE_CONTAINEROF(worker->display_channel->common.base.rcc, DisplayChannelClient, common.base) : NULL)
+ (worker->display_channel ? SPICE_CONTAINEROF(worker->display_channel->common.base.rcc,\
+ DisplayChannelClient, common.base) : NULL)
#define DCC_TO_DC(dcc) SPICE_CONTAINEROF((dcc)->common.base.channel,\
DisplayChannel, common.base)
@@ -1481,7 +1485,8 @@ static inline void red_pipes_remove_drawable(Drawable *drawable)
RING_FOREACH_SAFE(item, next, &drawable->pipes) {
dpi = SPICE_CONTAINEROF(item, DrawablePipeItem, base);
if (pipe_item_is_linked(&dpi->dpi_pipe_item)) {
- red_channel_client_pipe_remove_and_release(&dpi->dcc->common.base, &dpi->dpi_pipe_item);
+ red_channel_client_pipe_remove_and_release(&dpi->dcc->common.base,
+ &dpi->dpi_pipe_item);
}
}
}
@@ -1934,7 +1939,8 @@ static void red_current_clear(RedWorker *worker, int surface_id)
}
}
-static void red_clear_surface_drawables_from_pipe(DisplayChannelClient *dcc, int surface_id, int force)
+static void red_clear_surface_drawables_from_pipe(DisplayChannelClient *dcc, int surface_id,
+ int force)
{
Ring *ring;
PipeItem *item;
@@ -2340,7 +2346,9 @@ static int is_equal_path(RedWorker *worker, SpicePath *path1, SpicePath *path2)
// partial imp
static int is_equal_brush(SpiceBrush *b1, SpiceBrush *b2)
{
- return b1->type == b2->type && b1->type == SPICE_BRUSH_TYPE_SOLID && b1->u.color == b1->u.color;
+ return b1->type == b2->type &&
+ b1->type == SPICE_BRUSH_TYPE_SOLID &&
+ b1->u.color == b1->u.color;
}
// partial imp
@@ -2379,9 +2387,11 @@ static int is_same_drawable(RedWorker *worker, Drawable *d1, Drawable *d2)
switch (d1->red_drawable->type) {
case QXL_DRAW_STROKE:
- return is_equal_brush(&d1->red_drawable->u.stroke.brush, &d2->red_drawable->u.stroke.brush);
+ return is_equal_brush(&d1->red_drawable->u.stroke.brush,
+ &d2->red_drawable->u.stroke.brush);
case QXL_DRAW_FILL:
- return is_equal_brush(&d1->red_drawable->u.fill.brush, &d2->red_drawable->u.fill.brush);
+ return is_equal_brush(&d1->red_drawable->u.fill.brush,
+ &d2->red_drawable->u.fill.brush);
default:
return FALSE;
}
@@ -2936,7 +2946,8 @@ static inline void pre_stream_item_swap(RedWorker *worker, Stream *stream)
return;
}
- double drop_factor = ((double)agent->frames - (double)agent->drops) / (double)agent->frames;
+ double drop_factor = ((double)agent->frames - (double)agent->drops) /
+ (double)agent->frames;
if (drop_factor == 1) {
if (agent->fps < MAX_FPS) {
@@ -3072,7 +3083,8 @@ static inline int red_current_add_equal(RedWorker *worker, DrawItem *item, TreeI
other_drawable = SPICE_CONTAINEROF(other_draw_item, Drawable, tree_item);
if (item->effect == QXL_EFFECT_OPAQUE) {
- int add_after = !!other_drawable->stream && is_drawable_independent_from_surfaces(drawable);
+ int add_after = !!other_drawable->stream &&
+ is_drawable_independent_from_surfaces(drawable);
red_stream_maintenance(worker, drawable, other_drawable);
__current_add_drawable(worker, drawable, &other->siblings_link);
other_drawable->refs++;
@@ -3355,7 +3367,8 @@ static inline Shadow *__new_shadow(RedWorker *worker, Drawable *item, SpicePoint
return shadow;
}
-static inline int red_current_add_with_shadow(RedWorker *worker, Ring *ring, Drawable *item, SpicePoint *delta)
+static inline int red_current_add_with_shadow(RedWorker *worker, Ring *ring, Drawable *item,
+ SpicePoint *delta)
{
#ifdef RED_WORKER_STAT
stat_time_t start_time = stat_now();
@@ -3737,7 +3750,8 @@ static inline void red_inc_surfaces_drawable_dependencies(RedWorker *worker, Dra
}
}
-static inline void red_process_drawable(RedWorker *worker, RedDrawable *drawable, uint32_t group_id)
+static inline void red_process_drawable(RedWorker *worker, RedDrawable *drawable,
+ uint32_t group_id)
{
int surface_id;
Drawable *item = get_drawable(worker, drawable->effect, drawable, group_id);
@@ -3810,7 +3824,8 @@ static inline void red_create_surface(RedWorker *worker, uint32_t surface_id,uin
uint32_t height, int32_t stride, uint32_t format,
void *line_0, int data_is_valid, int send_client);
-static inline void red_process_surface(RedWorker *worker, RedSurfaceCmd *surface, uint32_t group_id, int loadvm)
+static inline void red_process_surface(RedWorker *worker, RedSurfaceCmd *surface,
+ uint32_t group_id, int loadvm)
{
int surface_id;
RedSurface *red_surface;
@@ -4818,8 +4833,8 @@ static void red_current_flush(RedWorker *worker, int surface_id)
}
// adding the pipe item after pos. If pos == NULL, adding to head.
-static ImageItem *red_add_surface_area_image(DisplayChannelClient *dcc, int surface_id, SpiceRect *area,
- PipeItem *pos, int can_lossy)
+static ImageItem *red_add_surface_area_image(DisplayChannelClient *dcc, int surface_id,
+ SpiceRect *area, PipeItem *pos, int can_lossy)
{
DisplayChannel *display_channel = DCC_TO_DC(dcc);
RedWorker *worker = display_channel->common.worker;
@@ -5049,7 +5064,7 @@ static RedGlzDrawable *red_display_get_glz_drawable(DisplayChannelClient *dcc, D
RedGlzDrawable *ret;
RingItem *item;
- // TODO - I don't really understand what's going on here, so just doing the technical equivalent
+ // TODO - I don't really understand what's going on here, so doing the technical equivalent
// now that we have multiple glz_dicts, so the only way to go from dcc to drawable glz is to go
// over the glz_ring (unless adding some better data structure then a ring)
DRAWABLE_FOREACH_GLZ(drawable, item, ret) {
@@ -6164,7 +6179,8 @@ static inline int red_compress_image(DisplayChannelClient *dcc,
} else {
if (drawable->copy_bitmap_graduality == BITMAP_GRADUAL_INVALID) {
quic_compress = BITMAP_FMT_IS_RGB[src->format] &&
- (_get_bitmap_graduality_level(display_channel->common.worker, src, drawable->group_id) ==
+ (_get_bitmap_graduality_level(display_channel->common.worker, src,
+ drawable->group_id) ==
BITMAP_GRADUAL_HIGH);
} else {
quic_compress = (drawable->copy_bitmap_graduality == BITMAP_GRADUAL_HIGH);
@@ -7094,7 +7110,8 @@ static void red_marshall_qxl_draw_transparent(RedWorker *worker,
SpiceMarshaller *src_bitmap_out;
SpiceTransparent transparent;
- red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_DRAW_TRANSPARENT, &dpi->dpi_pipe_item);
+ red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_DRAW_TRANSPARENT,
+ &dpi->dpi_pipe_item);
fill_base(base_marshaller, item);
transparent = drawable->u.transparent;
spice_marshall_Transparent(base_marshaller,
@@ -7144,13 +7161,15 @@ static FillBitsType red_marshall_qxl_draw_alpha_blend(RedWorker *worker,
SpiceAlphaBlend alpha_blend;
FillBitsType src_send_type;
- red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND, &dpi->dpi_pipe_item);
+ red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND,
+ &dpi->dpi_pipe_item);
fill_base(base_marshaller, item);
alpha_blend = drawable->u.alpha_blend;
spice_marshall_AlphaBlend(base_marshaller,
&alpha_blend,
&src_bitmap_out);
- src_send_type = fill_bits(dcc, src_bitmap_out, alpha_blend.src_bitmap, item, src_allowed_lossy);
+ src_send_type = fill_bits(dcc, src_bitmap_out, alpha_blend.src_bitmap, item,
+ src_allowed_lossy);
return src_send_type;
}
@@ -8766,7 +8785,8 @@ static void red_migrate_display(RedWorker *worker, RedChannelClient *rcc)
red_pipe_add_verb(rcc, PIPE_ITEM_TYPE_MIGRATE);
// red_pipes_add_verb(&worker->display_channel->common.base,
// SPICE_MSG_DISPLAY_STREAM_DESTROY_ALL);
-// red_channel_pipes_add_type(&worker->display_channel->common.base, PIPE_ITEM_TYPE_MIGRATE);
+// red_channel_pipes_add_type(&worker->display_channel->common.base,
+// PIPE_ITEM_TYPE_MIGRATE);
}
}
@@ -9068,8 +9088,8 @@ static inline void flush_cursor_commands(RedWorker *worker)
}
}
-// TODO: on timeout, don't disconnect all channeld immeduiatly - try to disconnect the slowest ones first
-// and maybe turn timeouts to several timeouts in order to disconnect channels gradually.
+// TODO: on timeout, don't disconnect all channeld immeduiatly - try to disconnect the slowest ones
+// first and maybe turn timeouts to several timeouts in order to disconnect channels gradually.
// Should use disconnect or shutdown?
static inline void flush_all_qxl_commands(RedWorker *worker)
{
@@ -9404,7 +9424,8 @@ static uint64_t display_channel_handle_migrate_data_get_serial(
return migrate_data->message_serial;
}
-static uint64_t display_channel_handle_migrate_data(RedChannelClient *rcc, uint32_t size, void *message)
+static uint64_t display_channel_handle_migrate_data(RedChannelClient *rcc, uint32_t size,
+ void *message)
{
DisplayChannelMigrateData *migrate_data;
DisplayChannel *display_channel = SPICE_CONTAINEROF(rcc->channel, DisplayChannel, common.base);
@@ -9461,7 +9482,8 @@ static uint64_t display_channel_handle_migrate_data(RedChannelClient *rcc, uint3
return TRUE;
}
-static int display_channel_handle_message(RedChannelClient *rcc, uint32_t size, uint16_t type, void *message)
+static int display_channel_handle_message(RedChannelClient *rcc, uint32_t size, uint16_t type,
+ void *message)
{
DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
switch (type) {
@@ -9497,7 +9519,8 @@ static int common_channel_config_socket(RedChannelClient *rcc)
// TODO - this should be dynamic, not one time at channel creation
delay_val = main_channel_client_is_low_bandwidth(mcc) ? 0 : 1;
- if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
+ if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val,
+ sizeof(delay_val)) == -1) {
if (errno != ENOTSUP) {
red_printf("setsockopt failed, %s", strerror(errno));
}
@@ -9625,7 +9648,7 @@ static RedChannel *__new_channel(RedWorker *worker, int size, uint32_t channel_t
channel_handle_parsed_proc handle_parsed,
channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark,
channel_handle_migrate_data_proc handle_migrate_data,
- channel_handle_migrate_data_get_serial_proc handle_migrate_data_get_serial)
+ channel_handle_migrate_data_get_serial_proc migrate_get_serial)
{
RedChannel *channel = NULL;
CommonChannel *common;
@@ -9640,7 +9663,7 @@ static RedChannel *__new_channel(RedWorker *worker, int size, uint32_t channel_t
channel_cbs.release_recv_buf = common_release_recv_buf;
channel_cbs.handle_migrate_flush_mark = handle_migrate_flush_mark;
channel_cbs.handle_migrate_data = handle_migrate_data;
- channel_cbs.handle_migrate_data_get_serial = handle_migrate_data_get_serial;
+ channel_cbs.handle_migrate_data_get_serial = migrate_get_serial;
channel = red_channel_create_parser(size, &worker_core,
channel_type, worker->id,
@@ -10350,7 +10373,8 @@ static inline void red_cursor_reset(RedWorker *worker)
worker->cursor_trail_length = worker->cursor_trail_frequency = 0;
if (cursor_is_connected(worker)) {
- red_channel_pipes_add_type(&worker->cursor_channel->common.base, PIPE_ITEM_TYPE_INVAL_CURSOR_CACHE);
+ red_channel_pipes_add_type(&worker->cursor_channel->common.base,
+ PIPE_ITEM_TYPE_INVAL_CURSOR_CACHE);
if (!worker->cursor_channel->common.base.migrate) {
red_pipes_add_verb(&worker->cursor_channel->common.base, SPICE_MSG_CURSOR_RESET);
}
@@ -10407,8 +10431,8 @@ static void dev_create_primary_surface(RedWorker *worker, uint32_t surface_id,
PANIC_ON(((uint64_t)abs(surface.stride) * (uint64_t)surface.height) !=
abs(surface.stride) * surface.height);
- line_0 = (uint8_t*)get_virt(&worker->mem_slots, surface.mem, surface.height * abs(surface.stride),
- surface.group_id);
+ line_0 = (uint8_t*)get_virt(&worker->mem_slots, surface.mem,
+ surface.height * abs(surface.stride), surface.group_id);
if (surface.stride < 0) {
line_0 -= (int32_t)(surface.stride * (surface.height -1));
}
commit 046b88ec64864e3bfd024217b8bad5f2b89b7147
Author: Dan McGee <dpmcgee at gmail.com>
Date: Thu Jan 19 14:09:58 2012 -0600
Fix line length errors in main_channel
These are all existing errors; fix them so they don't block future
commits in this file unnecessarily.
error (1): length @ server/main_channel.c +369
error (2): length @ server/main_channel.c +444
error (3): length @ server/main_channel.c +764
error (4): length @ server/main_channel.c +932
error (5): length @ server/main_channel.c +1044
Signed-off-by: Dan McGee <dpmcgee at gmail.com>
diff --git a/server/main_channel.c b/server/main_channel.c
index c4b2752..f7e1ab0 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -360,7 +360,8 @@ void main_channel_push_mouse_mode(MainChannel *main_chan, int current_mode,
main_mouse_mode_item_new, &info);
}
-static void main_channel_marshall_mouse_mode(SpiceMarshaller *m, int current_mode, int is_client_mouse_allowed)
+static void main_channel_marshall_mouse_mode(SpiceMarshaller *m, int current_mode,
+ int is_client_mouse_allowed)
{
SpiceMsgMainMouseMode mouse_mode;
mouse_mode.supported_modes = SPICE_MOUSE_MODE_SERVER;
@@ -435,7 +436,8 @@ static void main_channel_push_migrate_data_item(MainChannel *main_chan)
static void main_channel_marshall_migrate_data_item(SpiceMarshaller *m, int serial, int ping_id)
{
- MainMigrateData *data = (MainMigrateData *)spice_marshaller_reserve_space(m, sizeof(MainMigrateData));
+ MainMigrateData *data = (MainMigrateData *)
+ spice_marshaller_reserve_space(m, sizeof(MainMigrateData));
reds_marshall_migrate_data_item(m, data); // TODO: from reds split. ugly separation.
data->serial = serial;
@@ -755,7 +757,8 @@ void main_channel_client_handle_migrate_end(MainChannelClient *mcc)
mcc->mig_wait_prev_complete = FALSE;
}
}
-static int main_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint16_t type, void *message)
+static int main_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint16_t type,
+ void *message)
{
MainChannel *main_chan = SPICE_CONTAINEROF(rcc->channel, MainChannel, base);
MainChannelClient *mcc = SPICE_CONTAINEROF(rcc, MainChannelClient, base);
@@ -927,13 +930,10 @@ static MainChannelClient *main_channel_client_create(MainChannel *main_chan, Red
int num_common_caps, uint32_t *common_caps,
int num_caps, uint32_t *caps)
{
- MainChannelClient *mcc = (MainChannelClient*)red_channel_client_create(sizeof(MainChannelClient),
- &main_chan->base,
- client, stream,
- num_common_caps,
- common_caps,
- num_caps,
- caps);
+ MainChannelClient *mcc = (MainChannelClient*)
+ red_channel_client_create(sizeof(MainChannelClient), &main_chan->base,
+ client, stream, num_common_caps,
+ common_caps, num_caps, caps);
mcc->connection_id = connection_id;
mcc->bitrate_per_sec = ~0;
@@ -1039,7 +1039,8 @@ int main_channel_migrate_connect(MainChannel *main_channel, RedsMigSpice *mig_ta
main_channel->num_clients_mig_wait = 0;
RING_FOREACH(client_link, &main_channel->base.clients) {
- MainChannelClient * mcc = SPICE_CONTAINEROF(client_link, MainChannelClient, base.channel_link);
+ MainChannelClient * mcc = SPICE_CONTAINEROF(client_link, MainChannelClient,
+ base.channel_link);
if (red_channel_client_test_remote_cap(&mcc->base,
SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE)) {
if (red_client_during_migrate_at_target(mcc->base.client)) {
commit 6032a95205844c89cbc6ac6e055358c1034b03b0
Author: Alon Levy <alevy at redhat.com>
Date: Tue Jan 17 17:38:28 2012 +0200
docs/Spice_for_newbies.odt: some updates - added copy paste and wan mention, removed vdi_port
diff --git a/docs/Spice_for_newbies.odt b/docs/Spice_for_newbies.odt
index 99a1be5..1b05ee6 100644
Binary files a/docs/Spice_for_newbies.odt and b/docs/Spice_for_newbies.odt differ
commit 88f68f5329fc1107107c3a81c7fc0b7f7063ae25
Author: Alon Levy <alevy at redhat.com>
Date: Tue Jan 17 17:37:59 2012 +0200
server/red_channel: avoid segfault if stream == NULL
diff --git a/server/red_channel.c b/server/red_channel.c
index e526179..d2c9e6d 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -162,6 +162,10 @@ static void red_peer_handle_incoming(RedsStream *stream, IncomingHandler *handle
uint16_t msg_type;
uint32_t msg_size;
+ if (!stream) {
+ return;
+ }
+
for (;;) {
int ret_handle;
if (handler->header_pos < handler->header.header_size) {
commit 7dbdd93bf97436dd523721a090aaea63fd0a8b3b
Author: Alon Levy <alevy at redhat.com>
Date: Tue Jan 17 17:37:28 2012 +0200
client/foreign_menu: arm build fix
diff --git a/client/foreign_menu.cpp b/client/foreign_menu.cpp
index d1df49d..faef4c2 100644
--- a/client/foreign_menu.cpp
+++ b/client/foreign_menu.cpp
@@ -30,7 +30,7 @@
#ifdef WIN32
#define PIPE_NAME "SpiceForeignMenu-%lu"
-#elif defined(__i386__)
+#elif defined(__i386__) || __SIZEOF_LONG__ == 4
#define PIPE_NAME "/tmp/SpiceForeignMenu-%llu.uds"
#else
#define PIPE_NAME "/tmp/SpiceForeignMenu-%lu.uds"
commit afd7dfde1f3e13a989491de28933bee10fbab0be
Author: Alon Levy <alevy at redhat.com>
Date: Tue Jan 17 10:30:49 2012 +0200
import existing odt docs
diff --git a/docs/Spice_for_newbies.odt b/docs/Spice_for_newbies.odt
new file mode 100644
index 0000000..99a1be5
Binary files /dev/null and b/docs/Spice_for_newbies.odt differ
diff --git a/docs/Spice_protocol.odt b/docs/Spice_protocol.odt
new file mode 100644
index 0000000..02a17a4
Binary files /dev/null and b/docs/Spice_protocol.odt differ
diff --git a/docs/Spice_style.odt b/docs/Spice_style.odt
new file mode 100644
index 0000000..efdcd1a
Binary files /dev/null and b/docs/Spice_style.odt differ
diff --git a/docs/Spice_user_manual.odt b/docs/Spice_user_manual.odt
new file mode 100644
index 0000000..6931f49
Binary files /dev/null and b/docs/Spice_user_manual.odt differ
diff --git a/docs/Vd_interfaces.odt b/docs/Vd_interfaces.odt
new file mode 100644
index 0000000..71da117
Binary files /dev/null and b/docs/Vd_interfaces.odt differ
commit dc7855967f4e8aa4f1aee422cb8f09a414d8c69e
Author: Hans de Goede <hdegoede at redhat.com>
Date: Wed Jan 18 10:47:30 2012 +0100
server: Don't complain if setsockopt NODELAY fails on unix sockets
With Daniel P. Berrange's patches to allow use of pre-supplied fd's
as channels, we can no longer be sure that our connections are TCP
sockets, so it makes no sense to complain if a TCP/IP specific
setsockopt fails with an errno of ENOTSUP.
Note that this extends Daniel's commit 492ddb5d1d595e2d12208f4602b18e4432f4e6b4
which already added the same check to server/inputs_channel.c
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
diff --git a/server/red_tunnel_worker.c b/server/red_tunnel_worker.c
index c2019dd..9162da4 100644
--- a/server/red_tunnel_worker.c
+++ b/server/red_tunnel_worker.c
@@ -3365,7 +3365,9 @@ static int tunnel_channel_config_socket(RedChannelClient *rcc)
if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val,
sizeof(delay_val)) == -1) {
- red_printf("setsockopt failed, %s", strerror(errno));
+ if (errno != ENOTSUP) {
+ red_printf("setsockopt failed, %s", strerror(errno));
+ }
}
return TRUE;
diff --git a/server/red_worker.c b/server/red_worker.c
index 983d767..c2ab957 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -9498,7 +9498,9 @@ static int common_channel_config_socket(RedChannelClient *rcc)
// TODO - this should be dynamic, not one time at channel creation
delay_val = main_channel_client_is_low_bandwidth(mcc) ? 0 : 1;
if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
- red_printf("setsockopt failed, %s", strerror(errno));
+ if (errno != ENOTSUP) {
+ red_printf("setsockopt failed, %s", strerror(errno));
+ }
}
return TRUE;
}
diff --git a/server/reds.c b/server/reds.c
index b97a061..2492a89 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2706,7 +2706,9 @@ static RedLinkInfo *reds_init_client_connection(int socket)
}
if (setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
- red_printf("setsockopt failed, %s", strerror(errno));
+ if (errno != ENOTSUP) {
+ red_printf("setsockopt failed, %s", strerror(errno));
+ }
}
link = spice_new0(RedLinkInfo, 1);
diff --git a/server/snd_worker.c b/server/snd_worker.c
index 0527009..cb64c99 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -919,12 +919,16 @@ static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_i
tos = IPTOS_LOWDELAY;
if (setsockopt(stream->socket, IPPROTO_IP, IP_TOS, (void*)&tos, sizeof(tos)) == -1) {
- red_printf("setsockopt failed, %s", strerror(errno));
+ if (errno != ENOTSUP) {
+ red_printf("setsockopt failed, %s", strerror(errno));
+ }
}
delay_val = main_channel_client_is_low_bandwidth(mcc) ? 0 : 1;
if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
- red_printf("setsockopt failed, %s", strerror(errno));
+ if (errno != ENOTSUP) {
+ red_printf("setsockopt failed, %s", strerror(errno));
+ }
}
if (fcntl(stream->socket, F_SETFL, flags | O_NONBLOCK) == -1) {
diff --git a/server/spicevmc.c b/server/spicevmc.c
index c2e249c..5cdc513 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -92,8 +92,10 @@ static int spicevmc_red_channel_client_config_socket(RedChannelClient *rcc)
if (rcc->channel->type == SPICE_CHANNEL_USBREDIR) {
if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY,
&delay_val, sizeof(delay_val)) != 0) {
- red_printf("setsockopt failed, %s", strerror(errno));
- return FALSE;
+ if (errno != ENOTSUP) {
+ red_printf("setsockopt failed, %s", strerror(errno));
+ return FALSE;
+ }
}
}
More information about the Spice-commits
mailing list