colo: fix return without releasing RCU
Use WITH_RCU_READ_LOCK_GUARD to avoid exiting colo_init_ram_cache without releasing RCU. Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
293a733df7
commit
44901b5aff
|
@ -3890,7 +3890,7 @@ int colo_init_ram_cache(void)
|
||||||
{
|
{
|
||||||
RAMBlock *block;
|
RAMBlock *block;
|
||||||
|
|
||||||
rcu_read_lock();
|
WITH_RCU_READ_LOCK_GUARD() {
|
||||||
RAMBLOCK_FOREACH_NOT_IGNORED(block) {
|
RAMBLOCK_FOREACH_NOT_IGNORED(block) {
|
||||||
block->colo_cache = qemu_anon_ram_alloc(block->used_length,
|
block->colo_cache = qemu_anon_ram_alloc(block->used_length,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -3909,7 +3909,8 @@ int colo_init_ram_cache(void)
|
||||||
}
|
}
|
||||||
memcpy(block->colo_cache, block->host, block->used_length);
|
memcpy(block->colo_cache, block->host, block->used_length);
|
||||||
}
|
}
|
||||||
rcu_read_unlock();
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Record the dirty pages that sent by PVM, we use this dirty bitmap together
|
* Record the dirty pages that sent by PVM, we use this dirty bitmap together
|
||||||
* with to decide which page in cache should be flushed into SVM's RAM. Here
|
* with to decide which page in cache should be flushed into SVM's RAM. Here
|
||||||
|
|
Loading…
Reference in New Issue