diff options
Diffstat (limited to 'server/spicevmc.c')
-rw-r--r-- | server/spicevmc.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/server/spicevmc.c b/server/spicevmc.c index 36c5dafa..d1e8222e 100644 --- a/server/spicevmc.c +++ b/server/spicevmc.c @@ -220,13 +220,13 @@ static void spicevmc_red_channel_client_on_disconnect(RedChannelClient *rcc) state = SPICE_CONTAINEROF(rcc->channel, SpiceVmcState, channel); if (state->recv_from_client_buf) { /* partial message which wasn't pushed to device */ - spice_char_device_write_buffer_release(state->chardev, state->recv_from_client_buf); + red_char_device_write_buffer_release(state->chardev, state->recv_from_client_buf); state->recv_from_client_buf = NULL; } if (state->chardev) { - if (spice_char_device_client_exists(state->chardev, rcc->client)) { - spice_char_device_client_remove(state->chardev, rcc->client); + if (red_char_device_client_exists(state->chardev, rcc->client)) { + red_char_device_client_remove(state->chardev, rcc->client); } else { spice_printerr("client %p have already been removed from char dev %p", rcc->client, state->chardev); @@ -275,7 +275,7 @@ static int spicevmc_channel_client_handle_migrate_data(RedChannelClient *rcc, spice_error("bad header"); return FALSE; } - return spice_char_device_state_restore(state->chardev, &mig_data->base); + return red_char_device_restore(state->chardev, &mig_data->base); } static int spicevmc_red_channel_client_handle_message(RedChannelClient *rcc, @@ -293,7 +293,7 @@ static int spicevmc_red_channel_client_handle_message(RedChannelClient *rcc, case SPICE_MSGC_SPICEVMC_DATA: spice_assert(state->recv_from_client_buf->buf == msg); state->recv_from_client_buf->buf_used = size; - spice_char_device_write_buffer_add(state->chardev, state->recv_from_client_buf); + red_char_device_write_buffer_add(state->chardev, state->recv_from_client_buf); state->recv_from_client_buf = NULL; break; case SPICE_MSGC_PORT_EVENT: @@ -323,9 +323,9 @@ static uint8_t *spicevmc_red_channel_alloc_msg_rcv_buf(RedChannelClient *rcc, case SPICE_MSGC_SPICEVMC_DATA: assert(!state->recv_from_client_buf); - state->recv_from_client_buf = spice_char_device_write_buffer_get(state->chardev, - rcc->client, - size); + state->recv_from_client_buf = red_char_device_write_buffer_get(state->chardev, + rcc->client, + size); if (!state->recv_from_client_buf) { spice_error("failed to allocate write buffer"); return NULL; @@ -350,7 +350,7 @@ static void spicevmc_red_channel_release_msg_rcv_buf(RedChannelClient *rcc, switch (type) { case SPICE_MSGC_SPICEVMC_DATA: if (state->recv_from_client_buf) { /* buffer wasn't pushed to device */ - spice_char_device_write_buffer_release(state->chardev, state->recv_from_client_buf); + red_char_device_write_buffer_release(state->chardev, state->recv_from_client_buf); state->recv_from_client_buf = NULL; } break; @@ -386,7 +386,7 @@ static void spicevmc_red_channel_send_migrate_data(RedChannelClient *rcc, spice_marshaller_add_uint32(m, SPICE_MIGRATE_DATA_SPICEVMC_MAGIC); spice_marshaller_add_uint32(m, SPICE_MIGRATE_DATA_SPICEVMC_VERSION); - spice_char_device_state_migrate_data_marshall(state->chardev, m); + red_char_device_migrate_data_marshall(state->chardev, m); } static void spicevmc_red_channel_send_port_init(RedChannelClient *rcc, @@ -486,8 +486,8 @@ static void spicevmc_connect(RedChannel *channel, RedClient *client, spicevmc_port_send_init(rcc); } - if (!spice_char_device_client_add(state->chardev, client, FALSE, 0, ~0, ~0, - red_channel_client_is_waiting_for_migrate_data(rcc))) { + if (!red_char_device_client_add(state->chardev, client, FALSE, 0, ~0, ~0, + red_channel_client_is_waiting_for_migrate_data(rcc))) { spice_warning("failed to add client to spicevmc"); red_channel_client_disconnect(rcc); return; @@ -537,12 +537,12 @@ RedCharDevice *spicevmc_device_connect(RedsState *reds, char_dev_cbs.send_tokens_to_client = spicevmc_char_dev_send_tokens_to_client; char_dev_cbs.remove_client = spicevmc_char_dev_remove_client; - state->chardev = spice_char_device_state_create(sin, - reds, - 0, /* tokens interval */ - ~0, /* self tokens */ - &char_dev_cbs, - state); + state->chardev = red_char_device_create(sin, + reds, + 0, /* tokens interval */ + ~0, /* self tokens */ + &char_dev_cbs, + state); state->chardev_sin = sin; reds_register_channel(reds, &state->channel); @@ -555,13 +555,13 @@ void spicevmc_device_disconnect(RedsState *reds, SpiceCharDeviceInstance *sin) SpiceVmcState *state; /* FIXME */ - state = (SpiceVmcState *)spice_char_device_state_opaque_get((RedCharDevice*)sin->st); + state = (SpiceVmcState *)red_char_device_opaque_get((RedCharDevice*)sin->st); if (state->recv_from_client_buf) { - spice_char_device_write_buffer_release(state->chardev, state->recv_from_client_buf); + red_char_device_write_buffer_release(state->chardev, state->recv_from_client_buf); } /* FIXME */ - spice_char_device_state_destroy((RedCharDevice*)sin->st); + red_char_device_destroy((RedCharDevice*)sin->st); state->chardev = NULL; sin->st = NULL; @@ -580,7 +580,7 @@ SPICE_GNUC_VISIBLE void spice_server_port_event(SpiceCharDeviceInstance *sin, ui } /* FIXME */ - state = (SpiceVmcState *)spice_char_device_state_opaque_get((RedCharDevice*)sin->st); + state = (SpiceVmcState *)red_char_device_opaque_get((RedCharDevice*)sin->st); if (event == SPICE_PORT_EVENT_OPENED) { state->port_opened = TRUE; } else if (event == SPICE_PORT_EVENT_CLOSED) { |