mirror of https://github.com/xemu-project/xemu.git
Flush IO requests before savevm (original patch by Blue Swirl).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2140 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
a917d384ac
commit
6192bc374f
11
block-raw.c
11
block-raw.c
|
@ -247,6 +247,17 @@ void qemu_aio_poll(void)
|
||||||
the_end: ;
|
the_end: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Wait for all IO requests to complete. */
|
||||||
|
void qemu_aio_flush(void)
|
||||||
|
{
|
||||||
|
qemu_aio_wait_start();
|
||||||
|
qemu_aio_poll();
|
||||||
|
while (first_aio) {
|
||||||
|
qemu_aio_wait();
|
||||||
|
}
|
||||||
|
qemu_aio_wait_end();
|
||||||
|
}
|
||||||
|
|
||||||
/* wait until at least one AIO was handled */
|
/* wait until at least one AIO was handled */
|
||||||
static sigset_t wait_oset;
|
static sigset_t wait_oset;
|
||||||
|
|
||||||
|
|
6
vl.c
6
vl.c
|
@ -4551,6 +4551,9 @@ void do_savevm(const char *name)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ??? Should this occur after vm_stop? */
|
||||||
|
qemu_aio_flush();
|
||||||
|
|
||||||
saved_vm_running = vm_running;
|
saved_vm_running = vm_running;
|
||||||
vm_stop(0);
|
vm_stop(0);
|
||||||
|
|
||||||
|
@ -4641,6 +4644,9 @@ void do_loadvm(const char *name)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Flush all IO requests so they don't interfere with the new state. */
|
||||||
|
qemu_aio_flush();
|
||||||
|
|
||||||
saved_vm_running = vm_running;
|
saved_vm_running = vm_running;
|
||||||
vm_stop(0);
|
vm_stop(0);
|
||||||
|
|
||||||
|
|
1
vl.h
1
vl.h
|
@ -580,6 +580,7 @@ void bdrv_aio_cancel(BlockDriverAIOCB *acb);
|
||||||
|
|
||||||
void qemu_aio_init(void);
|
void qemu_aio_init(void);
|
||||||
void qemu_aio_poll(void);
|
void qemu_aio_poll(void);
|
||||||
|
void qemu_aio_flush(void);
|
||||||
void qemu_aio_wait_start(void);
|
void qemu_aio_wait_start(void);
|
||||||
void qemu_aio_wait(void);
|
void qemu_aio_wait(void);
|
||||||
void qemu_aio_wait_end(void);
|
void qemu_aio_wait_end(void);
|
||||||
|
|
Loading…
Reference in New Issue