[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/40] migration: Define MultifdRecvParams sooner
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 12/40] migration: Define MultifdRecvParams sooner |
Date: |
Wed, 16 May 2018 01:39:49 +0200 |
Once there, we don't need the struct names anywhere, just the
typedefs. And now also document all fields.
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
---
migration/ram.c | 46 +++++++++++++++++++++++++++++++---------------
1 file 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 */
--
2.17.0
- [Qemu-devel] [PULL 01/40] migration: fix saving normal page even if it's been compressed, (continued)
- [Qemu-devel] [PULL 01/40] migration: fix saving normal page even if it's been compressed, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 03/40] tests: Migration ppc now inlines its program, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 05/40] migration: Introduce multifd_recv_new_channel(), Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 04/40] migration: Set error state in case of error, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 06/40] migration: terminate_* can be called for other threads, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 09/40] migration: Create multifd channels, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 08/40] migration: Export functions to create send channels, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 10/40] migration: Delay start of migration main routines, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 11/40] migration: Transmit initial package through the multifd channels, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 13/40] migration: let incoming side use thread context, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 12/40] migration: Define MultifdRecvParams sooner,
Juan Quintela <=
- [Qemu-devel] [PULL 07/40] migration: Be sure all recv channels are created, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 14/40] migration: new postcopy-pause state, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 16/40] migration: allow dst vm pause on postcopy, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 17/40] migration: allow src return path to pause, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 18/40] migration: allow fault thread to pause, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 19/40] qmp: hmp: add migrate "resume" option, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 15/40] migration: implement "postcopy-pause" src logic, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 20/40] migration: rebuild channel on source, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 22/40] migration: wakeup dst ram-load-thread for recover, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 23/40] migration: new cmd MIG_CMD_RECV_BITMAP, Juan Quintela, 2018/05/15