diff options
author | Juan Quintela <quintela@redhat.com> | 2018-04-07 13:59:07 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2018-05-15 20:24:27 +0200 |
commit | 8c4598f2b1f65ca063d0d5e0dc7f621e2023a0fd (patch) | |
tree | 43d2d81fd9c529cc37b6568d36d3d1c994636af7 /migration/ram.c | |
parent | af8b7d2b09471051aba8e6ed5c468469a1ea8309 (diff) |
migration: Define MultifdRecvParams sooner
Once there, we don't need the struct names anywhere, just the
typedefs. And now also document all fields.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration/ram.c')
-rw-r--r-- | migration/ram.c | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/migration/ram.c b/migration/ram.c index f46a373074..cb14399ef9 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -445,17 +445,45 @@ typedef struct { uint8_t id; } __attribute__((packed)) MultiFDInit_t; -struct MultiFDSendParams { +typedef struct { + /* this fields are not changed once the thread is created */ + /* channel number */ uint8_t id; + /* channel thread name */ char *name; + /* channel thread id */ QemuThread thread; + /* communication channel */ QIOChannel *c; + /* sem where to wait for more work */ QemuSemaphore sem; + /* this mutex protects the following parameters */ QemuMutex mutex; + /* is this channel thread running */ bool running; + /* should this thread finish */ bool quit; -}; -typedef struct MultiFDSendParams MultiFDSendParams; +} MultiFDSendParams; + +typedef struct { + /* this fields are not changed once the thread is created */ + /* channel number */ + uint8_t id; + /* channel thread name */ + char *name; + /* channel thread id */ + QemuThread thread; + /* communication channel */ + QIOChannel *c; + /* sem where to wait for more work */ + QemuSemaphore sem; + /* this mutex protects the following parameters */ + QemuMutex mutex; + /* is this channel thread running */ + bool running; + /* should this thread finish */ + bool quit; +} MultiFDRecvParams; static int multifd_send_initial_packet(MultiFDSendParams *p, Error **errp) { @@ -657,18 +685,6 @@ int multifd_save_setup(void) return 0; } -struct MultiFDRecvParams { - uint8_t id; - char *name; - QemuThread thread; - QIOChannel *c; - QemuSemaphore sem; - QemuMutex mutex; - bool running; - bool quit; -}; -typedef struct MultiFDRecvParams MultiFDRecvParams; - struct { MultiFDRecvParams *params; /* number of created threads */ |