aboutsummaryrefslogtreecommitdiff
path: root/migration/ram.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2018-04-18 00:38:17 +0200
committerJuan Quintela <quintela@redhat.com>2018-06-27 13:28:11 +0200
commit4d22c148c989f80e4377233bed886e96d85ef645 (patch)
tree4e1c8924652416d96cd0f588e1d43721818df6fe /migration/ram.c
parent8b2db7f5fd9566ab9cf22b02b623c51b2075a60e (diff)
downloadqemu-4d22c148c989f80e4377233bed886e96d85ef645.zip
qemu-4d22c148c989f80e4377233bed886e96d85ef645.tar.gz
qemu-4d22c148c989f80e4377233bed886e96d85ef645.tar.bz2
migration: Wait for blocking IO
We have three conditions here: - channel fails -> error - we have to quit: we close the channel and reads fails - normal read that success, we are in bussiness So forget the complications of waiting in a semaphore. 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.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/migration/ram.c b/migration/ram.c
index b9c8f65..5d38d69 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -602,8 +602,6 @@ typedef struct {
bool running;
/* should this thread finish */
bool quit;
- /* thread has work to do */
- bool pending_job;
/* array of pages to receive */
MultiFDPages_t *pages;
/* packet allocated len */
@@ -1199,14 +1197,6 @@ static void multifd_recv_sync_main(void)
for (i = 0; i < migrate_multifd_channels(); i++) {
MultiFDRecvParams *p = &multifd_recv_state->params[i];
- trace_multifd_recv_sync_main_signal(p->id);
- qemu_mutex_lock(&p->mutex);
- p->pending_job = true;
- qemu_mutex_unlock(&p->mutex);
- }
- for (i = 0; i < migrate_multifd_channels(); i++) {
- MultiFDRecvParams *p = &multifd_recv_state->params[i];
-
trace_multifd_recv_sync_main_wait(p->id);
qemu_sem_wait(&multifd_recv_state->sem_sync);
qemu_mutex_lock(&p->mutex);
@@ -1219,7 +1209,6 @@ static void multifd_recv_sync_main(void)
MultiFDRecvParams *p = &multifd_recv_state->params[i];
trace_multifd_recv_sync_main_signal(p->id);
-
qemu_sem_post(&p->sem_sync);
}
trace_multifd_recv_sync_main(multifd_recv_state->packet_num);
@@ -1256,7 +1245,6 @@ static void *multifd_recv_thread(void *opaque)
used = p->pages->used;
flags = p->flags;
trace_multifd_recv(p->id, p->packet_num, used, flags);
- p->pending_job = false;
p->num_packets++;
p->num_pages += used;
qemu_mutex_unlock(&p->mutex);
@@ -1306,7 +1294,6 @@ int multifd_load_setup(void)
qemu_sem_init(&p->sem, 0);
qemu_sem_init(&p->sem_sync, 0);
p->quit = false;
- p->pending_job = false;
p->id = i;
p->pages = multifd_pages_init(page_count);
p->packet_len = sizeof(MultiFDPacket_t)