qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] migration: adding migration to/from a file


From: Ian Jackson
Subject: Re: [Qemu-devel] [PATCH] migration: adding migration to/from a file
Date: Tue, 20 Jan 2009 14:06:29 +0000

Uri Lublin writes ("Re: [Qemu-devel] [PATCH] migration: adding migration 
to/from a file"):
> Paul Brook wrote:
> > Wouldn't it be better to just implement savevm to file?
> 
> It sure is simpler.

In the Xen tree we already have an alternatively implementation of
savevm which does not depend on or interact with the cow snapshots.
See below.

This is a bit of a mess and it would be nice to have some
functionality in upstream that did the same thing.  NB that since we
want to retain compatibility with previous savefiles the exact syntax
of the data saved to the file is important.

FYI in the Xen case we don't need the live migration support that qemu
upstream and kvm have, because the RAM live migration is handled by
the Xen toolstack, and the remaining qemu saved state is small enough
to do all in one go.  But that doesn't mean that it's a bad idea.

Ian.

void do_savevm(const char *name)
{
    QEMUFile *f;
    int saved_vm_running, ret;

    f = qemu_fopen(name, "wb");
    
    /* ??? Should this occur after vm_stop?  */
    qemu_aio_flush();

    saved_vm_running = vm_running;
    vm_stop(0);

    if (!f) {
        fprintf(logfile, "Failed to open savevm file '%s'\n", name);
        goto the_end;
    }
    
    ret = qemu_savevm_state(f);
    qemu_fclose(f);

    if (ret < 0)
        fprintf(logfile, "Error %d while writing VM to savevm file '%s'\n",
                ret, name);

 the_end:
    if (saved_vm_running)
        vm_start();

    return;
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]