summaryrefslogtreecommitdiffstats
path: root/server/reds.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-19 14:10:16 +0200
committerAlexander Larsson <alexl@redhat.com>2010-07-19 16:28:22 +0200
commit12b08f2c3e07cea617255bedfd97b2eedf0f180f (patch)
tree9a35ebbc31d6b61e94d3fbcd72feb70f0e9b9858 /server/reds.c
parent2962bdaea056d7069303badc3d73ed9530fdbb15 (diff)
downloadspice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.tar.gz
spice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.tar.xz
spice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.zip
codegen: Various cleanups
Remove all uses of @end in the marshaller, instead just using the C struct array-at-end-of-struct. To make this work we also remove all use of @end for switches (making them C unions). We drop the zero member of the notify message so that we can avoid this use of @end for a primitive in the marshaller (plus its useless to send over the wire). We change the offsets and stuff in the migration messages to real pointers.
Diffstat (limited to 'server/reds.c')
-rw-r--r--server/reds.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/server/reds.c b/server/reds.c
index 97a47ae8..cf2d6abd 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3189,22 +3189,18 @@ static void reds_mig_continue(void)
RedsMigSpice *s = reds->mig_spice;
SpiceMsgMainMigrationBegin migrate;
RedsOutItem *item;
- int host_len;
red_printf("");
- host_len = strlen(s->host) + 1;
item = new_out_item(SPICE_MSG_MAIN_MIGRATE_BEGIN);
migrate.port = s->port;
migrate.sport = s->sport;
- migrate.host_offset = sizeof(SpiceMsgMainMigrationBegin);
- migrate.host_size = host_len;
+ migrate.host_size = strlen(s->host) + 1;
+ migrate.host_data = (uint8_t *)s->host;
migrate.pub_key_type = s->cert_pub_key_type;
- migrate.pub_key_offset = sizeof(SpiceMsgMainMigrationBegin) + host_len;
migrate.pub_key_size = s->cert_pub_key_len;
+ migrate.pub_key_data = s->cert_pub_key;
spice_marshall_msg_main_migrate_begin(item->m, &migrate);
- spice_marshaller_add(item->m, (uint8_t *)s->host, host_len);
- spice_marshaller_add(item->m, s->cert_pub_key, s->cert_pub_key_len);
reds_push_pipe_item(item);