This fixes an assertion failure in the following backtrace:
__GI___assert_fail
memory_region_transaction_commit
memory_region_add_eventfd
virtio_pci_ioeventfd_assign
virtio_bus_set_host_notifier
virtio_blk_data_plane_start
virtio_bus_start_ioeventfd
virtio_vmstate_change
vm_state_notify
vm_prepare_start
vm_start
dump_cleanup
dump_process
dump_thread
start_thread
clone
vm_start need BQL, acquire it if doing cleaning up from main thread.
Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <
20170503072819[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
memory_mapping_list_free(&s->list);
close(s->fd);
if (s->resume) {
memory_mapping_list_free(&s->list);
close(s->fd);
if (s->resume) {
+ if (s->detached) {
+ qemu_mutex_lock_iothread();
+ }
+ if (s->detached) {
+ qemu_mutex_unlock_iothread();
+ }
if (detach_p) {
/* detached dump */
if (detach_p) {
/* detached dump */
qemu_thread_create(&s->dump_thread, "dump_thread", dump_thread,
s, QEMU_THREAD_DETACHED);
} else {
qemu_thread_create(&s->dump_thread, "dump_thread", dump_thread,
s, QEMU_THREAD_DETACHED);
} else {
uint32_t sh_info;
bool have_section;
bool resume;
uint32_t sh_info;
bool have_section;
bool resume;
ssize_t note_size;
hwaddr memory_offset;
int fd;
ssize_t note_size;
hwaddr memory_offset;
int fd;