Discussion:
[Qemu-discuss] Disk Caching when domain is suspended.
Matthew Schumacher
2018-11-14 20:50:09 UTC
Permalink
Qemu devs,

I have a process where I suspend a domain, then migrate some of it's
disk elsewhere, then live migrate (to copy cpu state and memory) the
domain to another host and resume.  The migration is marked unsafe in
libvirt because disk caching is enabled even though the domain is in the
suspend state.

Can someone confirm that the disk cache is flushed as part of the
suspend process?  If not, it seems reasonable that you would want the
disk completely quiesced while the domain was in the suspend state so
that you can perform tasks without worry that the disk is still changing.

Thanks,
schu
Matthew Schumacher
2018-11-14 22:01:12 UTC
Permalink
Post by Matthew Schumacher
Qemu devs,
I have a process where I suspend a domain, then migrate some of it's
disk elsewhere, then live migrate (to copy cpu state and memory) the
domain to another host and resume.  The migration is marked unsafe in
libvirt because disk caching is enabled even though the domain is in
the suspend state.
Can someone confirm that the disk cache is flushed as part of the
suspend process?  If not, it seems reasonable that you would want the
disk completely quiesced while the domain was in the suspend state so
that you can perform tasks without worry that the disk is still changing.
Thanks,
schu
I found this code in cpus.c

static int do_vm_stop(RunState state, bool send_stop)
{
    int ret = 0;

    if (runstate_is_running()) {
        cpu_disable_ticks();
        pause_all_vcpus();
        runstate_set(state);
        vm_state_notify(0, state);
        if (send_stop) {
            qapi_event_send_stop(&error_abort);
        }
    }

    bdrv_drain_all();
    replay_disable_events();
    ret = bdrv_flush_all();

    return ret;
}

That would lead me to believe that it does flush the cache with
bdrv_drain_all and bdrv_flush_all, but I'm not entirely sure without a
bit of code analysis, so a quick confirmation would be welcome.

Thanks,
schu

Continue reading on narkive:
Loading...