summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-02-06 14:10:29 -0600
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-02-23 23:00:46 +0100
commitc2556da161015a58cf82b17969e0beeaff287afe (patch)
treeba52a3dea45e1d6a9b5774bc6ad379ebae59d70c
parent1c7cf80e55776fd1e4b60d972c309390660587dc (diff)
downloadspice-c2556da161015a58cf82b17969e0beeaff287afe.tar.gz
spice-c2556da161015a58cf82b17969e0beeaff287afe.tar.xz
spice-c2556da161015a58cf82b17969e0beeaff287afe.zip
CommonChannel -> CommonWorkerChannel
Rename this struct to make it clear that it's only the base class for worker channels (e.g. display and cursor), not all channels. Also renamed CommonChannelClient to CommonWorkerChannelClient.
-rw-r--r--server/cursor-channel.c26
-rw-r--r--server/dcc.c6
-rw-r--r--server/dcc.h4
-rw-r--r--server/display-channel.c6
-rw-r--r--server/display-channel.h2
-rw-r--r--server/red-worker.c46
-rw-r--r--server/red-worker.h44
-rw-r--r--server/stream.c2
8 files changed, 68 insertions, 68 deletions
diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index 421b1e2a..aaf61b6c 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -38,7 +38,7 @@ typedef struct CursorPipeItem {
} CursorPipeItem;
struct _CursorChannel {
- CommonChannel common; // Must be the first thing
+ CommonWorkerChannel common; // Must be the first thing
CursorItem *item;
int cursor_visible;
@@ -53,7 +53,7 @@ struct _CursorChannel {
};
struct _CursorChannelClient {
- CommonChannelClient common;
+ CommonWorkerChannelClient common;
CacheItem *cursor_cache[CURSOR_CACHE_HASH_SIZE];
Ring cursor_cache_lru;
@@ -413,7 +413,7 @@ static void cursor_channel_release_item(RedChannelClient *rcc, PipeItem *item, i
CursorChannel* cursor_channel_new(RedWorker *worker)
{
CursorChannel *cursor;
- CommonChannel *channel = NULL;
+ CommonWorkerChannel *channel = NULL;
ChannelCbs cbs = {
.on_disconnect = cursor_channel_client_on_disconnect,
.send_item = cursor_channel_send_item,
@@ -455,15 +455,15 @@ CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor, RedClient
spice_return_val_if_fail(!num_caps || caps, NULL);
CursorChannelClient *ccc =
- (CursorChannelClient*)common_channel_new_client(&cursor->common,
- sizeof(CursorChannelClient),
- client, stream,
- mig_target,
- FALSE,
- common_caps,
- num_common_caps,
- caps,
- num_caps);
+ (CursorChannelClient*)common_worker_channel_new_client(&cursor->common,
+ sizeof(CursorChannelClient),
+ client, stream,
+ mig_target,
+ FALSE,
+ common_caps,
+ num_common_caps,
+ caps,
+ num_caps);
spice_return_val_if_fail(ccc != NULL, NULL);
ring_init(&ccc->cursor_cache_lru);
@@ -548,7 +548,7 @@ void cursor_channel_init(CursorChannel *cursor, CursorChannelClient *client)
{
spice_return_if_fail(cursor);
- if (COMMON_CHANNEL(cursor)->during_target_migrate) {
+ if (COMMON_WORKER_CHANNEL(cursor)->during_target_migrate) {
spice_debug("during_target_migrate: skip init");
return;
}
diff --git a/server/dcc.c b/server/dcc.c
index 7efdbd2e..099d696b 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -331,8 +331,8 @@ DisplayChannelClient *dcc_new(DisplayChannel *display,
{
DisplayChannelClient *dcc;
- dcc = (DisplayChannelClient*)common_channel_new_client(
- COMMON_CHANNEL(display), sizeof(DisplayChannelClient),
+ dcc = (DisplayChannelClient*)common_worker_channel_new_client(
+ COMMON_WORKER_CHANNEL(display), sizeof(DisplayChannelClient),
client, stream, mig_target, TRUE,
common_caps, num_common_caps,
caps, num_caps);
@@ -524,7 +524,7 @@ void dcc_destroy_surface(DisplayChannelClient *dcc, uint32_t surface_id)
RedChannel *channel = RED_CHANNEL(display);
SurfaceDestroyItem *destroy;
- if (!dcc || COMMON_CHANNEL(display)->during_target_migrate ||
+ if (!dcc || COMMON_WORKER_CHANNEL(display)->during_target_migrate ||
!dcc->surface_client_created[surface_id]) {
return;
}
diff --git a/server/dcc.h b/server/dcc.h
index 2f884529..ead36232 100644
--- a/server/dcc.h
+++ b/server/dcc.h
@@ -39,7 +39,7 @@ typedef struct FreeList {
} FreeList;
struct _DisplayChannelClient {
- CommonChannelClient common;
+ CommonWorkerChannelClient common;
spice_image_compression_t image_compression;
spice_wan_compression_t jpeg_state;
spice_wan_compression_t zlib_glz_state;
@@ -100,7 +100,7 @@ struct _DisplayChannelClient {
};
#define DCC_TO_WORKER(dcc) \
- (SPICE_CONTAINEROF((dcc)->common.base.channel, CommonChannel, base)->worker)
+ (SPICE_CONTAINEROF((dcc)->common.base.channel, CommonWorkerChannel, base)->worker)
#define DCC_TO_DC(dcc) \
SPICE_CONTAINEROF((dcc)->common.base.channel, DisplayChannel, common.base)
#define RCC_TO_DCC(rcc) SPICE_CONTAINEROF((rcc), DisplayChannelClient, common.base)
diff --git a/server/display-channel.c b/server/display-channel.c
index e76cac5c..d471997f 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -235,7 +235,7 @@ static void stop_streams(DisplayChannel *display)
void display_channel_surface_unref(DisplayChannel *display, uint32_t surface_id)
{
RedSurface *surface = &display->surfaces[surface_id];
- RedWorker *worker = COMMON_CHANNEL(display)->worker;
+ RedWorker *worker = COMMON_WORKER_CHANNEL(display)->worker;
QXLInstance *qxl = red_worker_get_qxl(worker);
DisplayChannelClient *dcc;
RingItem *link, *next;
@@ -1364,7 +1364,7 @@ void display_channel_drawable_unref(DisplayChannel *display, Drawable *drawable)
SPICE_CONTAINEROF(item, RedGlzDrawable, drawable_link)->drawable = NULL;
ring_remove(item);
}
- red_drawable_unref(COMMON_CHANNEL(display)->worker, drawable->red_drawable, drawable->group_id);
+ red_drawable_unref(COMMON_WORKER_CHANNEL(display)->worker, drawable->red_drawable, drawable->group_id);
drawable_free(display, drawable);
display->drawable_count--;
}
@@ -1859,7 +1859,7 @@ static void on_disconnect(RedChannelClient *rcc)
spice_return_if_fail(rcc != NULL);
display = DCC_TO_DC(dcc);
- worker = COMMON_CHANNEL(display)->worker;
+ worker = COMMON_WORKER_CHANNEL(display)->worker;
spice_return_if_fail(rcc->channel == red_worker_get_display_channel(worker));
dcc_stop(dcc); // TODO: start/stop -> connect/disconnect?
diff --git a/server/display-channel.h b/server/display-channel.h
index b095d482..2ad96dc8 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -150,7 +150,7 @@ struct _Drawable {
};
struct DisplayChannel {
- CommonChannel common; // Must be the first thing
+ CommonWorkerChannel common; // Must be the first thing
uint32_t bits_unique;
MonitorsConfig *monitors_config;
diff --git a/server/red-worker.c b/server/red-worker.c
index 63b3aeeb..05022fb0 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -134,7 +134,7 @@ static int cursor_is_connected(RedWorker *worker)
static uint8_t *common_alloc_recv_buf(RedChannelClient *rcc, uint16_t type, uint32_t size)
{
- CommonChannel *common = SPICE_CONTAINEROF(rcc->channel, CommonChannel, base);
+ CommonWorkerChannel *common = SPICE_CONTAINEROF(rcc->channel, CommonWorkerChannel, base);
/* SPICE_MSGC_MIGRATE_DATA is the only client message whose size is dynamic */
if (type == SPICE_MSGC_MIGRATE_DATA) {
@@ -496,7 +496,7 @@ static int common_channel_config_socket(RedChannelClient *rcc)
RedClient *client = red_channel_client_get_client(rcc);
MainChannelClient *mcc = red_client_get_main(client);
RedsStream *stream = red_channel_client_get_stream(rcc);
- CommonChannelClient *ccc = COMMON_CHANNEL_CLIENT(rcc);
+ CommonWorkerChannelClient *ccc = COMMON_WORKER_CHANNEL_CLIENT(rcc);
int flags;
int delay_val;
@@ -626,7 +626,7 @@ static void worker_watch_update_mask(SpiceWatch *watch, int events)
RedWorker *worker;
spice_return_if_fail(watch != NULL);
- worker = SPICE_CONTAINEROF(watch->rcc->channel, CommonChannel, base)->worker;
+ worker = SPICE_CONTAINEROF(watch->rcc->channel, CommonWorkerChannel, base)->worker;
if (watch->source) {
g_source_destroy(watch->source);
@@ -653,7 +653,7 @@ static SpiceWatch* worker_watch_add(int fd, int events, SpiceWatchFunc func, voi
/* Since we are called from red_channel_client_create()
CommonChannelClient->worker has not been set yet! */
- worker = SPICE_CONTAINEROF(rcc->channel, CommonChannel, base)->worker;
+ worker = SPICE_CONTAINEROF(rcc->channel, CommonWorkerChannel, base)->worker;
spice_return_val_if_fail(worker != NULL, NULL);
spice_return_val_if_fail(worker->main_context != NULL, NULL);
@@ -689,16 +689,16 @@ static const SpiceCoreInterface worker_core = {
.watch_remove = worker_watch_remove,
};
-CommonChannelClient *common_channel_new_client(CommonChannel *common,
- int size,
- RedClient *client,
- RedsStream *stream,
- int mig_target,
- int monitor_latency,
- uint32_t *common_caps,
- int num_common_caps,
- uint32_t *caps,
- int num_caps)
+CommonWorkerChannelClient *common_worker_channel_new_client(CommonWorkerChannel *common,
+ int size,
+ RedClient *client,
+ RedsStream *stream,
+ int mig_target,
+ int monitor_latency,
+ uint32_t *common_caps,
+ int num_common_caps,
+ uint32_t *caps,
+ int num_caps)
{
RedChannelClient *rcc =
red_channel_client_create(size, &common->base, client, stream, monitor_latency,
@@ -706,7 +706,7 @@ CommonChannelClient *common_channel_new_client(CommonChannel *common,
if (!rcc) {
return NULL;
}
- CommonChannelClient *common_cc = (CommonChannelClient*)rcc;
+ CommonWorkerChannelClient *common_cc = (CommonWorkerChannelClient*)rcc;
common_cc->worker = common->worker;
common_cc->id = common->worker->qxl->id;
common->during_target_migrate = mig_target;
@@ -719,14 +719,14 @@ CommonChannelClient *common_channel_new_client(CommonChannel *common,
}
-CommonChannel *red_worker_new_channel(RedWorker *worker, int size,
- const char *name,
- uint32_t channel_type, int migration_flags,
- ChannelCbs *channel_cbs,
- channel_handle_parsed_proc handle_parsed)
+CommonWorkerChannel *red_worker_new_channel(RedWorker *worker, int size,
+ const char *name,
+ uint32_t channel_type, int migration_flags,
+ ChannelCbs *channel_cbs,
+ channel_handle_parsed_proc handle_parsed)
{
RedChannel *channel = NULL;
- CommonChannel *common;
+ CommonWorkerChannel *common;
spice_return_val_if_fail(worker, NULL);
spice_return_val_if_fail(channel_cbs, NULL);
@@ -748,7 +748,7 @@ CommonChannel *red_worker_new_channel(RedWorker *worker, int size,
spice_return_val_if_fail(channel, NULL);
red_channel_set_stat_node(channel, reds_stat_add_node(reds, worker->stat, name, TRUE));
- common = (CommonChannel *)channel;
+ common = (CommonWorkerChannel *)channel;
common->worker = worker;
return common;
}
@@ -1038,7 +1038,7 @@ static void handle_dev_start(void *opaque, uint32_t message_type, void *payload)
spice_assert(!worker->running);
if (worker->cursor_channel) {
- COMMON_CHANNEL(worker->cursor_channel)->during_target_migrate = FALSE;
+ COMMON_WORKER_CHANNEL(worker->cursor_channel)->during_target_migrate = FALSE;
}
if (worker->display_channel) {
worker->display_channel->common.during_target_migrate = FALSE;
diff --git a/server/red-worker.h b/server/red-worker.h
index 0b5c6155..43797cdc 100644
--- a/server/red-worker.h
+++ b/server/red-worker.h
@@ -26,20 +26,20 @@
typedef struct RedWorker RedWorker;
-typedef struct CommonChannelClient {
+typedef struct CommonWorkerChannelClient {
RedChannelClient base;
uint32_t id;
RedWorker *worker;
int is_low_bandwidth;
-} CommonChannelClient;
+} CommonWorkerChannelClient;
-#define COMMON_CHANNEL_CLIENT(Client) ((CommonChannelClient*)(Client))
+#define COMMON_WORKER_CHANNEL_CLIENT(Client) ((CommonWorkerChannelClient*)(Client))
#define DISPLAY_CLIENT_TIMEOUT 30000000000ULL //nano
#define CHANNEL_RECEIVE_BUF_SIZE 1024
-typedef struct CommonChannel {
+typedef struct CommonWorkerChannel {
RedChannel base; // Must be the first thing
struct RedWorker *worker;
@@ -50,9 +50,9 @@ typedef struct CommonChannel {
The flag is used to avoid sending messages that are artifacts
of the transition from stopped vm to loaded vm (e.g., recreation
of the primary surface) */
-} CommonChannel;
+} CommonWorkerChannel;
-#define COMMON_CHANNEL(Channel) ((CommonChannel*)(Channel))
+#define COMMON_WORKER_CHANNEL(Channel) ((CommonWorkerChannel*)(Channel))
enum {
PIPE_ITEM_TYPE_VERB = PIPE_ITEM_TYPE_CHANNEL_BASE,
@@ -109,21 +109,21 @@ RedMemSlotInfo* red_worker_get_memslot(RedWorker *worker);
void red_drawable_unref(RedWorker *worker, RedDrawable *red_drawable,
uint32_t group_id);
-CommonChannel *red_worker_new_channel(RedWorker *worker, int size,
- const char *name,
- uint32_t channel_type, int migration_flags,
- ChannelCbs *channel_cbs,
- channel_handle_parsed_proc handle_parsed);
-
-CommonChannelClient *common_channel_new_client(CommonChannel *common,
- int size,
- RedClient *client,
- RedsStream *stream,
- int mig_target,
- int monitor_latency,
- uint32_t *common_caps,
- int num_common_caps,
- uint32_t *caps,
- int num_caps);
+CommonWorkerChannel *red_worker_new_channel(RedWorker *worker, int size,
+ const char *name,
+ uint32_t channel_type, int migration_flags,
+ ChannelCbs *channel_cbs,
+ channel_handle_parsed_proc handle_parsed);
+
+CommonWorkerChannelClient *common_worker_channel_new_client(CommonWorkerChannel *common,
+ int size,
+ RedClient *client,
+ RedsStream *stream,
+ int mig_target,
+ int monitor_latency,
+ uint32_t *common_caps,
+ int num_common_caps,
+ uint32_t *caps,
+ int num_caps);
#endif
diff --git a/server/stream.c b/server/stream.c
index afcf722c..e1627762 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -427,7 +427,7 @@ static void display_channel_create_stream(DisplayChannel *display, Drawable *dra
GSource *source = g_timeout_source_new(RED_STREAM_INPUT_FPS_TIMEOUT);
g_source_set_callback(source, red_stream_input_fps_timer_cb, stream, NULL);
stream->input_fps_timer =
- g_source_attach(source, red_worker_get_context(COMMON_CHANNEL(display)->worker));
+ g_source_attach(source, red_worker_get_context(COMMON_WORKER_CHANNEL(display)->worker));
g_source_unref(source);
stream->num_input_frames = 0;