All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Programmingkid <programmingkidx@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Adding Save States menu items
Date: Fri, 7 Oct 2016 10:09:12 +0100	[thread overview]
Message-ID: <20161007090912.GC26332@redhat.com> (raw)
In-Reply-To: <e378bbfc-f592-7e2a-826e-10c2adf43eb8@redhat.com>

On Thu, Oct 06, 2016 at 02:59:49PM -0500, Eric Blake wrote:
> On 10/06/2016 09:22 AM, Programmingkid wrote:
> > Would you accept a patch that added "Save State" and "Restore State" menu items to the cocoa interface? They would allow the user to save the running state of the emulator.
> 
> Doesn't virt-manager already do this?  What do we gain by duplicating
> GUI functionality at this level that is already implemented at higher
> levels?  Not that I'm opposed to the idea, but having a solid reason why
> it is useful is important.
> 
> Speaking with libvirt experience: saving a guest is somewhat easy.  But
> once you have a save-state file, then what?  Remember, the qemu GUI is
> associated with a SINGLE qemu process.  When libvirt manages save files,
> it is managing MULTIPLE qemu processes.  The sequence of 'create a save
> file, hot-plug a device, then reverting to the save file' currently
> REQUIRES that you destroy one qemu process and create another one, where
> the new process is back to the pre-hotplug configuration that was in use
> when the save file was created.  Otherwise the qemu 'loadvm' command
> will likely fail (and worse, if it does not fail, you are likely to
> trigger even-harder-to-diagnose guest corruptions that only strike down
> the road, rather than at the time of the loadvm).
> 
> If your gui (whether cocoa or GTK) is associated with a single qemu
> process, then you will have a VERY tough time figuring out how to start
> a new qemu process to replace the current one while still keeping the
> gui unchanged.  And the work to convert qemu over to managing multiple
> VMs itself is rather pointless, when you already have libvirt and
> virt-manager and other wrappers that are already good at that.
> 
> Libvirt also learned that the qemu 'migrate-to-disk' format (used by
> 'savevm' or 'migrate') is NOT self-descriptive - in order to fully and
> safely revert to an earlier state, you HAVE to store the command line
> (or a way to regenerate the command line) that was associated with the
> qemu whose state you saved, along with tracking all hotplugs.

Even that is not in fact sufficient - most QEMU command lines do not
contain sufficient info to reliably restart the guest with the exact
same machine ABI. You have to fully expand and canonicalize the
command line so that it includes all the extra bits QEMU would silently
expand - eg device addresses, exact versioned machine type, etc. without
that, you'll fail to restore the guest on a different version of QEMU,
even if you used the exact same command line as before.

> Your idea may be noble, but I think you are going down a rabbit's hole
> of unimplementable misery, and advise that you probably won't succeed.

Agreed, it isn't a productive use of resources IMHO

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

  parent reply	other threads:[~2016-10-07  9:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 14:22 [Qemu-devel] Adding Save States menu items Programmingkid
2016-10-06 14:28 ` Peter Maydell
2016-10-06 14:42   ` Programmingkid
2016-10-06 15:35     ` Paolo Bonzini
2016-10-06 15:48       ` Programmingkid
2016-10-06 15:49         ` Paolo Bonzini
2016-10-06 16:04           ` Programmingkid
2016-10-06 16:17             ` Paolo Bonzini
2016-10-06 17:43               ` Programmingkid
2016-10-06 17:49                 ` Peter Maydell
2016-10-06 17:51                   ` Programmingkid
2016-10-06 20:03               ` Eric Blake
2016-10-06 19:59 ` Eric Blake
2016-10-06 20:10   ` Programmingkid
2016-10-06 20:26     ` Eric Blake
2016-10-07  7:21       ` Paolo Bonzini
2016-10-07  9:14         ` Daniel P. Berrange
2016-10-07 14:39           ` Programmingkid
2016-10-06 20:47   ` Peter Maydell
2016-10-06 21:07     ` Programmingkid
2016-10-07  8:46   ` Kevin Wolf
2016-10-07  9:09   ` Daniel P. Berrange [this message]
2016-10-07 14:55     ` Programmingkid
2016-10-07 14:57       ` Daniel P. Berrange
2016-10-07 14:59       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161007090912.GC26332@redhat.com \
    --to=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.