Commit Graph

1496 Commits

Author SHA1 Message Date
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
Yonit Halperin
1d2b071d15 migration_protocol: add migration data for char devices 2012-08-27 09:13:01 +03:00
Yonit Halperin
8875e1da45 replace some migration related spice_error calls with info/warning 2012-08-27 09:13:01 +03:00
Yonit Halperin
275e4312df seamless migration: migration completion on the destination side
Tracking the channels that wait for migration data. If there
is a new migration process pending, when all the channels have
restored their state, we begin the new migration.
2012-08-27 09:13:00 +03:00
Yonit Halperin
eb4c95b08b red_channel: handle sending SPICE_MSG_MIGRATE
The relevant code is common to all channels.

The patch also contains a fix to the return value for
handle_migrate_data callback: s/uint64_t/int
2012-08-27 09:13:00 +03:00
Yonit Halperin
4f551a3550 red_channel: fix pipe item leak 2012-08-27 09:12:59 +03:00
Yonit Halperin
bb8c90d8c2 seamleass migration: manage post migration phase in the src side
In semi-seamless, SPICE_MSG_MAIN_MIGRATE_END is sent.
In seamless, each channel migrates separately.

The src waits till all the clients are disconnected (or a timeout), and
then it notifies qemu that spice migration has completed.

The patch doesn't include the per-channel logic for seamless migration
(sending MSG_MIGRATE, MIGRATE_DATA, etc.).
2012-08-27 09:12:59 +03:00
Yonit Halperin
8e2576d5ab seamless migration: pre migration phase on the destination side
- handle SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS
- reply with SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK/NACK
- prepare the channels for migration according to the migration
   type (semi/seamless)

see spice-protocol for more details:
commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
2012-08-27 09:12:50 +03:00
Yonit Halperin
43e0897da5 seamless migration: pre migration phase on the src side
sending SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS and handling
SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS

The src side signals the client to establish a connection
to the destination.
In seamless migration, the client is also used to perform
a sort of handshake with the destination, for verifying
if seamless migration can be supported.

see spice-protocol for more details:
commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
2012-08-27 09:12:03 +03:00
Yonit Halperin
35cf65a45e seamless-migration: update spice-common submodule
Also Update server and client according to the change of
SpiceMsgMainMigrationBegin: it now holds all the fields inside
SpiceMigrationDstInfo.
2012-08-27 09:10:53 +03:00
Yonit Halperin
70f820ded2 seamless-migration: add migration_protocol.h
The file will hold the declarations of the different migration
data messages (depending on the channel), that will be passed
from the src server to the dst server, via the client, using
SPICE_MSG_MIGRATE_DATA.
2012-08-27 09:04:52 +03:00
Yonit Halperin
92f3ee6ed8 bump version to 0.11.2
New api entries:
    spice_server_vm_start
    spice_server_vm_stop
    spice_server_set_seamless_migration
2012-08-27 09:04:52 +03:00
Yonit Halperin
f45fb9e1b6 spice.h: add spice_server_set_seamless_migration
This new call is used in order to identify whether qemu, or
the management (e.g. libvirt), support seamless migration.
If it is supported, qemu spice cmd-line configuration should have
seamless-migration=on.

In addition, we disable seamless migration support if multiple clients
are allowed. Currently, only one client is supported.
2012-08-27 09:04:52 +03:00
Yonit Halperin
2a1369c919 spice_server_vm_start/stop: notify red_dispatcher on vm start/stop
Till now, red_worker was notfied about vm status changes via QXLWorker->start/stop
(or spice_qxl_start/stop).
Newer qemu, that supports calling spice_server_vm_start/stop, will call only
these routines, and won't call QXLWorker->start/stop.
2012-08-27 09:04:52 +03:00
Yonit Halperin
c302e12c78 spice.h: add entries for tracking vm state
When vm state changes (started/stopped), we notify all the
attached SpiceCharDeviceStates about the change. This is mainly required
for avoiding writing/reading to/from the device during the non-live
stage of migration.

spice version will be bumped in one of the following patches.
2012-08-27 09:04:51 +03:00
Yonit Halperin
11033ca5dc reds: add tracking for char devices
The list of attached char_devices will be used in the next patch
for notifying each instance of SpiceCharDeviceState when the vm
is started or stopped.
2012-08-27 09:04:51 +03:00
Yonit Halperin
8d02c14d20 agent: don't attempt to read from the device if it was released
if vdi_port_read_buf_process failes, we detach the agent and also release
the read buffer. We shouldn't try reading from the device afterwards.
2012-08-27 09:04:51 +03:00
Yonit Halperin
56c9548f64 agent: reset client tokens when notifying on agent connection
send SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS
2012-08-27 09:04:51 +03:00
Yonit Halperin
49a8d68303 red_channel: add red_channel_test_remote_cap
for checking if all the channel clients connected support the cap
2012-08-27 09:04:18 +03:00
Søren Sandmann Pedersen
37be9e0c2e Add support for Composite command to the client
All the real work is being done in spice-common, so this patch is just
hooking up the virtual calls and adding the SPICE_DISPLAY_CAP_COMPOSITE
capability.
2012-08-24 13:45:31 -04:00
Søren Sandmann Pedersen
a91daa2feb Add support for QXLComposite to spice server
In red-parse-qxl.c add support for parsing QXLComposite into
SpiceComposite. In red-worker.c add support for marshalling
SpiceComposite onto the wire.
2012-08-24 13:44:42 -04:00
Søren Sandmann Pedersen
22b64d2ae2 Add support for LZ compression of A8 images
Graduality is irrelevant for A8 images, so instead of using RGB-ness
as a short-cut, add a new macro BITMAP_FMT_HAS_GRADUALITY() that
returns true for the existing RGB images, but false for A8.
2012-08-24 13:44:32 -04:00
Marc-André Lureau
54db42bf60 Update spice-common 2012-08-09 12:45:59 +02:00
Yonit Halperin
cf6e58fe33 red_worker: Fix reference counting for the current frame (drawable) of a stream
After marshalling MSG_STREAM_CREATE, there is no need to ref and
unref stream->current before and after completing the sending of the
message (correspondingly). The referencing is unnecessary because all
the data that is required from the drawable (the clipping), is copied
during marshalling, and no field in the drawable is referenced (see
spice_marshall_msg_display_stream_create).

Moreover, the referencing was bugous:
While display_channel_hold_pipe_item and
display_channel_client_release_item_after_push referenced and
dereferenced, correspondingly, stream->current, stream->current might
have changed in between these calls, and then we ended up with one drawable
leaking, and one drawable released before its time has come (which
of course led to critical errors).
2012-07-25 14:16:41 +03:00
Alon Levy
ad7c5ca72a bump version to 0.11.1 for new spice_qxl_monitors_config_async
bump current and age since only additions where done.
new server library is libspice-server.so.1.2.0 .
2012-07-23 15:46:53 +03:00
Alon Levy
0acea04d71 server: add monitors_config support
a SpiceMsgDisplayMonitorsConfig is sent on two occasions:
 * as a result of a spice_qxl_monitors_config_async
 * whenever a client connects and there is a previously set monitors
   config

Sending the new message is protected by a new cap,
SPICE_DISPLAY_CAP_MONITORS_CONFIG

More elaborately:
spice_qxl_monitors_config_async receives a QXLPHYSICAL address of a
QXLMonitorsConfig struct and reads it, caching it in the RedWorker, and
sending it to all clients. Whenever a new client connects it receives
a SpiceMsgDisplayMonitorsConfig message as well.
2012-07-22 13:50:49 +03:00
Alon Levy
e29dc5250c server/red_parse_qxl: red_get_image: fix leaks on bad image 2012-07-22 13:50:16 +03:00
Alon Levy
7863b18cd7 server/red_worker: release bad drawables 2012-07-22 13:37:44 +03:00
Alon Levy
827f40e05c server/red_parse_qxl: disallow zero area bitmaps
prevents division by zero later (SIGFPE, Arithmetic exception) in
spice-common code, at spice-common/common/canvas_base.c:646
for both client and server (server only upon rendering).
2012-07-22 13:37:44 +03:00
Alon Levy
341d273bad server/red_parse_qxl: get_path: remove return NULL
introduced by 2ec2dbc78a
2012-07-22 13:37:44 +03:00
Alon Levy
9aa630b4d7 server/reds: more fixes for wrong spice_error in d2c99b59 2012-07-22 13:34:11 +03:00