Commit Graph

1526 Commits

Author SHA1 Message Date
Alon Levy
12c4349de7 server/tests/test_two_servers 2012-09-02 13:36:49 +03:00
Alon Levy
caea769943 server/tests: introduce Test struct 2012-09-02 13:36:41 +03:00
Alon Levy
897aaa7be5 server/red_worker: seamless: fix invalid memory reference
replace add_ref with add for stack allocated SpiceMigrateDataDisplay.

This fixes wrong MIGRATE_DATA message in display channel (symptom is
glz_encoder_max being way too big, and malloc failure at target) seen on
F18 with gcc-4.7.1-5.fc18.x86_64 and glibc-2.16-8.fc18.x86_64 (didn't
appear on RHEL 6).
2012-08-30 17:08:10 +03:00
Alon Levy
3d28317e97 server: freezed->froze, missing whitespace after declarations 2012-08-30 17:08:09 +03:00
Alon Levy
4f7876e4c8 server: s/max_encdoers/max_encoders/ 2012-08-30 17:08:09 +03:00
Yonit Halperin
1dbe5af2ac server/inputs_channel.c: whitespace fix 2012-08-30 17:08:09 +03:00
Alon Levy
e9557228d8 server/red_tunnel_worker: remove unneeded expect_migrate_mark 2012-08-30 17:08:09 +03:00
Alon Levy
77a06903f6 server/red_tunnel_worker.c: fix build
Only passes compile, not tested.
2012-08-28 00:04:14 +03:00
Marc-André Lureau
560d8b0135 inputs: handle SPICE_MSGC_INPUTS_KEY_SCANCODE
Handle SPICE_MSGC_INPUTS_KEY_SCANCODE message, allowing arbitrary
keyboard scancode sequence.
2012-08-27 17:37:24 +02:00
Alon Levy
bd10d502f8 support automake >= 1.12
Requires a single line (sans comments) change to configure.ac in
spice-common too, to define the new AM_PROG_AR.
2012-08-27 16:17:17 +03:00
Alon Levy
e7aee13e57 server/red_worker: handle_dev_update_area: fail if invalid area 2012-08-27 16:17:17 +03:00
Yann E. MORIN
fd39b2c246 client: fix missing stdarg.h include
When the C library is uClibc, stdarg.h is required to get the
definition for va_list et al.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-08-27 14:18:29 +02:00
Yonit Halperin
c83a608fb4 enable seamless migration and set migration protocol version 2012-08-27 09:13:14 +03:00
Yonit Halperin
c24276d941 inputs channel migration: don't send any msg after MSG_MIGRATE
Pending motion acks, and keyboard modifiers messages will be sent
by the destination after receiving the migration data.
2012-08-27 09:13:13 +03:00
Yonit Halperin
b18c6d4298 inputs_channel: send and handle migration data 2012-08-27 09:13:13 +03:00
Yonit Halperin
0f4bc12090 migration_protocol: add inputs channel migration data
Storing the motion count in uint16_t and not in uint32_t since
the exact count is not important, just its division in
SPICE_INPUT_MOTION_ACK_BUNCH (see the next 2 patches).
2012-08-27 09:13:13 +03:00
Yonit Halperin
115d095d46 main_channel: don't expect init msg in a seamless migration destination
If the server is a destination of seamless migration, send msgs to the client,
even though an init msg has not been sent to the client.
2012-08-27 09:13:12 +03:00
Yonit Halperin
e142bd9a61 red_channel: set send_data.last_sent_serial in red_channel_client_set_message_serial
red_channel_client_set_message_serial is called for setting
the serial of the display channel messages after migration (on the
destination side). The serial is retrieved from the migration data.
2012-08-27 09:13:12 +03:00
Yonit Halperin
26027036c0 red_channel: remove unused migrate flag from RedChannel
The relevant flags reside in RedChannelClient and RedClient
2012-08-27 09:13:12 +03:00
Yonit Halperin
934fb14ccc snd_worker: handling migration
The playback and record channel send SPICE_MSG_MIGRATE to the client.
Both playback and record channel does not have a state to restore:
while in the legacy migration implementation the record channel
used to restore the mode and start time, it looks unnecessary since
the client receives from the src MSG_RECORD_STOP before the migration
completion notification (when the vm is stopped). Afterwards, when the vm
starts on the dest side, the client receives MSG_RECORD_START.
2012-08-27 09:13:11 +03:00
Yonit Halperin
8874f3b259 snd_channel: fix double release
Due to the fix in the previous patch, snd_disconnect_channel can be
called both when there is write/read error in the channel, or from
red_client_destroy (which calls client_cbs.disconnect).
Multiple calls to snd_disconnect_channel resulted in calling
channel->cleanup(channel) more than once (double release).
2012-08-27 09:13:11 +03:00
Yonit Halperin
08d223beb3 red_channel (dummy): fix not adding dummy RedChannelClient to the client
snd channel wasn't added to be part of the client's channels list.
As a result, when the client was destroyed, or migrated, snd channel
client wasn't destroy, or its migration callback wasn't called.

However, due to adding dummy channels to the client, we need special
handling for calls to disconnecting dummy channel clients.

TODO: we need to refactor snd_worker to use red_channel
2012-08-27 09:13:11 +03:00
Yonit Halperin
8e7b22b786 display migration: restore destination state
Restoring display channel from migration data.
Not notifying client about changes that are artifacts of loading the vm.
Remove legacy migration code.
2012-08-27 09:13:10 +03:00
Yonit Halperin
29776c9216 display migration: marshall migration data 2012-08-27 09:13:10 +03:00
Yonit Halperin
558c4cbb4c display & cursor migration: send SPICE_MSG_MIGRATE 2012-08-27 09:13:10 +03:00
Yonit Halperin
6b74168871 migration_protocol: add display channel migration data 2012-08-27 09:13:09 +03:00
Yonit Halperin
35227cd11f inputs channel: use the default red_channel behaviour for client_cbs.migrate
The default callback sends SPICE_MSG_MIGRATE to the client.
2012-08-27 09:13:09 +03:00
Yonit Halperin
5aec370a7a inputs channel: fix using spice messages enums as pipe items type
A channel pipe item type must start from PIPE_ITEM_TYPE_CHANNEL_BASE.
SPICE_MSG_MIGRATE value eq. PIPE_ITEM_TYPE_SET_ACK. Setting a pipe item
type to SPICE_MSG_MIGRATE, leads to red_channel handling PIPE_ITEM_TYPE_SET_ACK.
2012-08-27 09:13:09 +03:00
Yonit Halperin
9c6a49c364 char_device: don't connect a migrated client if the state of the device might have changed since it was created
If reading/writing from the device have occured before migration data
has arrived, the migration data might no longer be relvant, and we
disconnect the client.
2012-08-27 09:13:08 +03:00
Yonit Halperin
a180fc5e0b main: restore state from migration data
Also removed old migration leftovers.
2012-08-27 09:13:08 +03:00
Yonit Halperin
fa9bfd01f1 main: send migration data
Also removed some unused definitions from reds that used to belong to
old agent and migration code.
2012-08-27 09:13:07 +03:00
Yonit Halperin
3af4b7235d main: send MSG_MIGRATE upon vm migration completion
Before sending the above msg, if there is a pending partial msg that
has been read from the agent, we send it to the client. The alternative
was to keep the msg as part of the migration data, and then
to send it to the destination server via the client and to wait there
for the msg chunk completion, before sending it to the client. Of
course, the latter is less efficient.
2012-08-27 09:13:07 +03:00
Yonit Halperin
c617379821 reds: s/HADER/HEADER 2012-08-27 09:13:07 +03:00
Yonit Halperin
443b2d4270 migration_protocol: add migration data for the main channel (mainly for the agent) 2012-08-27 09:13:06 +03:00
Yonit Halperin
d866114d90 main_channel: fix using spice messages enums as pipe items type
A channel pipe item type must start from PIPE_ITEM_TYPE_CHANNEL_BASE.
SPICE_MSG_MIGRATE value eq. PIPE_ITEM_TYPE_SET_ACK. Setting a pipe item
type to SPICE_MSG_MIGRATE, leads to red_channel handling PIPE_ITEM_TYPE_SET_ACK.

Also removed sending SPICE_MSG_MIGRATE. It will be handled in the next
patch.
2012-08-27 09:13:06 +03:00
Yonit Halperin
157d459d42 red_channel: introduce PIPE_ITEM_TYPE_EMPTY_MSG
The pipe item is used for sending messages that don't have body.
2012-08-27 09:13:06 +03:00
Yonit Halperin
fdab42cc41 smartcard: restore state after migration from migration data 2012-08-27 09:13:05 +03:00
Yonit Halperin
e07dd381ab smartcard migration: send migration data 2012-08-27 09:13:05 +03:00
Yonit Halperin
6ff73836cf migration_protocol: add migration data for smartcard 2012-08-27 09:13:05 +03:00
Yonit Halperin
2670fb9765 smartcard: send MSG_MIGRATE upon vm migration completion
The above is the default behaviour for red_channel_client, if
client_cbs.migrate is not registered as part of red_channel_register_client_cbs
2012-08-27 09:13:04 +03:00
Yonit Halperin
6c9d1330af smartcard: fix PIPE_ITEMs enum indexing
The enum should start from PIPE_ITEM_TYPE_CHANNEL_BASE, otherwise,
PIPE_ITEM_TYPE_ERROR is handled like PIPE_ITEM_TYPE_SET_ACK.
2012-08-27 09:13:04 +03:00
Yonit Halperin
b3c16d2ae7 smartcard: change the timing of attaching a client to SpiceCharDeviceState
Attach/detach a client to a SpiceCharDeviceState upon its
connection/disconnection, instead of upon reader_add/remove messages.
When the client is removed from a SpiceCharDeviceState, all the
messages from this client are removed from the device write queue.
This shouldn't happen when we only receive reader_remove and the
client is still connected.
2012-08-27 09:13:04 +03:00
Yonit Halperin
733a804c99 spicevmc migration: restore migration dest state from migration data 2012-08-27 09:13:04 +03:00
Yonit Halperin
ef44c5eff9 spicevmc migration: send migration data 2012-08-27 09:13:03 +03:00
Yonit Halperin
15fe69e06b spicevmc: send MSG_MIGRATE upon vm migration completion
The above is the default behaviour for red_channel_client, if
client_cbs.migrate is not registered as part of red_channel_register_client_cbs
2012-08-27 09:13:03 +03:00
Yonit Halperin
1f85f1de65 migration_protocol: add migration data for spicevmc 2012-08-27 09:13:03 +03:00
Yonit Halperin
99ea64ac5a char device migration: restore state at destination from migration data 2012-08-27 09:13:02 +03:00
Yonit Halperin
cb767a83fd char device migration: don't read or write from/to the device while waiting for migraion data 2012-08-27 09:13:02 +03:00
Yonit Halperin
b0264a5e37 char device migration: marshall migration data 2012-08-27 09:13:02 +03:00
Yonit Halperin
520e2cd4f4 char_device: variable token price for write buffers
When restoring migration data, we also restore data that is addressed to
the device, and that might have been originated from more than 1
message. When the write buffer that is assoicated with this data is
released, we need to free all the relevant tokens.
2012-08-27 09:13:01 +03:00