Re: [PATCH] memory: Fix qemu crash on starting dirty log twice with stopped VM

2022-02-08 Thread Paolo Bonzini
On 2/7/22 11:36, Peter Xu wrote: Yeah I can do. Though the latter "if (!flags)" check will also start to allow nesting of memory_global_dirty_log_start(), and it'll make this assert useless: assert(!(global_dirty_tracking & flags)); I'll probably drop it too, then. Curious: do we have an

Re: [PATCH] memory: Fix qemu crash on starting dirty log twice with stopped VM

2022-02-07 Thread Peter Xu
On Mon, Feb 07, 2022 at 10:08:44AM +0100, Paolo Bonzini wrote: > > void memory_global_dirty_log_start(unsigned int flags) > > { > > unsigned int old_flags = global_dirty_tracking; > > -if (vmstate_change) { > > -qemu_del_vm_change_state_handler(vmstate_change); > > -vm

Re: [PATCH] memory: Fix qemu crash on starting dirty log twice with stopped VM

2022-02-07 Thread Paolo Bonzini
On 2/7/22 04:26, Peter Xu wrote: QEMU can now easily crash with two continuous migration carried out: (qemu) migrate -d exec:cat>out (qemu) migrate_cancel (qemu) migrate -d exec:cat>out [crash] ../softmmu/memory.c:2782: memory_global_dirty_log_start: Assertion `!(global_dirty_tracking & flags)'

[PATCH] memory: Fix qemu crash on starting dirty log twice with stopped VM

2022-02-06 Thread Peter Xu
QEMU can now easily crash with two continuous migration carried out: (qemu) migrate -d exec:cat>out (qemu) migrate_cancel (qemu) migrate -d exec:cat>out [crash] ../softmmu/memory.c:2782: memory_global_dirty_log_start: Assertion `!(global_dirty_tracking & flags)' failed. It's because memory API pr