[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v12 09/21] migration: Define MultifdRecvParams soone
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH v12 09/21] migration: Define MultifdRecvParams sooner |
Date: |
Wed, 25 Apr 2018 13:27:11 +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>
---
migration/ram.c | 46 +++++++++++++++++++++++++++++++---------------
1 file changed, 31 insertions(+), 15 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 1aab392d8f..ffefa73099 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -412,17 +412,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)
{
@@ -619,18 +647,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] [PATCH v12 00/21] Multifd, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 01/21] migration: Set error state in case of error, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 02/21] migration: Introduce multifd_recv_new_channel(), Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 03/21] migration: terminate_* can be called for other threads, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 05/21] migration: Export functions to create send channels, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 04/21] migration: Be sure all recv channels are created, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 06/21] migration: Create multifd channels, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 07/21] migration: Delay start of migration main routines, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 08/21] migration: Transmit initial package through the multifd channels, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 09/21] migration: Define MultifdRecvParams sooner,
Juan Quintela <=
- [Qemu-devel] [PATCH v12 10/21] migration: Create multipage support, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 11/21] migration: Create multifd packet, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 12/21] migration: Add multifd traces for start/end thread, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 13/21] migration: Calculate transferred ram correctly, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 14/21] migration: Multifd channels always wait on the sem, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 15/21] migration: Add block where to send/receive packets, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 18/21] migration: Start sending messages, Juan Quintela, 2018/04/25
- [Qemu-devel] [PATCH v12 17/21] migration: Create ram_multifd_page, Juan Quintela, 2018/04/25