diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2011-09-18 09:10:24 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2011-09-25 15:04:05 +0300 |
commit | 3ac0075cdac8fa42de47a7882022795e96cb1fee (patch) | |
tree | 08221200189c0f7f0ab68e20d232b4aff9239838 /server/reds.c | |
parent | 6e56bea67c5648b0c81990171d4bc0cf1a402043 (diff) | |
download | spice-3ac0075cdac8fa42de47a7882022795e96cb1fee.tar.gz spice-3ac0075cdac8fa42de47a7882022795e96cb1fee.tar.xz spice-3ac0075cdac8fa42de47a7882022795e96cb1fee.zip |
server: handle migration interface addition
Diffstat (limited to 'server/reds.c')
-rw-r--r-- | server/reds.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/server/reds.c b/server/reds.c index 9a983f8c..99d52f94 100644 --- a/server/reds.c +++ b/server/reds.c @@ -73,6 +73,7 @@ static SpiceKbdInstance *keyboard = NULL; static SpiceMouseInstance *mouse = NULL; static SpiceTabletInstance *tablet = NULL; static SpiceCharDeviceInstance *vdagent = NULL; +static SpiceMigrateInstance *migration_interface = NULL; #define MIGRATION_NOTIFY_SPICE_KEY "spice_mig_ext" @@ -4345,6 +4346,20 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s, red_printf("unsupported net wire interface"); return -1; #endif + } else if (strcmp(interface->type, SPICE_INTERFACE_MIGRATION) == 0) { + red_printf("SPICE_INTERFACE_MIGRATION"); + if (migration_interface) { + red_printf("already have migration"); + return -1; + } + + if (interface->major_version != SPICE_INTERFACE_MIGRATION_MAJOR || + interface->minor_version > SPICE_INTERFACE_MIGRATION_MINOR) { + red_printf("unsupported migration interface"); + return -1; + } + migration_interface = SPICE_CONTAINEROF(sin, SpiceMigrateInstance, base); + migration_interface->st = spice_new0(SpiceMigrateState, 1); } return 0; @@ -4859,7 +4874,15 @@ SPICE_GNUC_VISIBLE int spice_server_migrate_connect(SpiceServer *s, const char* int port, int secure_port, const char* cert_subject) { + SpiceMigrateInterface *sif; + red_printf(""); + ASSERT(migration_interface); + ASSERT(reds == s); + red_printf("not implemented yet"); + sif = SPICE_CONTAINEROF(migration_interface->base.sif, SpiceMigrateInterface, base); + sif->migrate_connect_complete(migration_interface); + return 0; } @@ -4920,8 +4943,14 @@ SPICE_GNUC_VISIBLE int spice_server_migrate_client_state(SpiceServer *s) SPICE_GNUC_VISIBLE int spice_server_migrate_end(SpiceServer *s, int completed) { + SpiceMigrateInterface *sif; + ASSERT(migration_interface); ASSERT(reds == s); reds_mig_finished(completed); + sif = SPICE_CONTAINEROF(migration_interface->base.sif, SpiceMigrateInterface, base); + if (sif->migrate_end_complete) { + sif->migrate_end_complete(migration_interface); + } return 0; } |