rcu: actually register threads that have RCU read-side critical sections

Otherwise, grace periods are detected too early!

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2015-07-09 08:55:38 +02:00
parent c170aad8b0
commit ab28bd2312
5 changed files with 21 additions and 0 deletions

View file

@ -22,6 +22,7 @@
#include "block/block.h"
#include "qapi/qmp/qerror.h"
#include "qemu/sockets.h"
#include "qemu/rcu.h"
#include "migration/block.h"
#include "qemu/thread.h"
#include "qmp-commands.h"
@ -917,6 +918,8 @@ static void *migration_thread(void *opaque)
int64_t start_time = initial_time;
bool old_vm_running = false;
rcu_register_thread();
qemu_savevm_state_header(s->file);
qemu_savevm_state_begin(s->file, &s->params);
@ -1016,6 +1019,7 @@ static void *migration_thread(void *opaque)
qemu_bh_schedule(s->cleanup_bh);
qemu_mutex_unlock_iothread();
rcu_unregister_thread();
return NULL;
}