|
| From: | Paolo Bonzini |
| Subject: | Re: [Qemu-devel] [PATCH] kvm: fix kvm_set_migration_log() behavior |
| Date: | Tue, 18 Feb 2014 17:16:20 +0100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
Il 18/02/2014 13:33, Vincent KHERBACHE ha scritto:
diff --git a/kvm-all.c b/kvm-all.c
index 2ca9143..f104f87 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -355,7 +355,7 @@ static int kvm_set_migration_log(int enable)
{
KVMState *s = kvm_state;
KVMSlot *mem;
- int i, err;
+ int i, err = 0;
s->migration_log = enable;
@@ -365,15 +365,9 @@ static int kvm_set_migration_log(int enable)
if (!mem->memory_size) {
continue;
}
- if (!!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) == enable) {
- continue;
- }
- err = kvm_set_user_memory_region(s, mem);
- if (err) {
- return err;
- }
+ err = kvm_slot_dirty_pages_log_change(mem, (bool)enable);
}
- return 0;
+ return err;
}
This patch is not correct, because it introduces another one: if dirty logging was enabled on the memory region (kvm_dirty_pages_log_change), it will be disabled after migration.
Can you explain better the problem? I cannot see anything wrong in the code, though it is not the clearest. Note that the effects of kvm_set_migration_log and kvm_dirty_pages_log_change should be logically ORed.
Paolo
| [Prev in Thread] | Current Thread | [Next in Thread] |