qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Drew DeVault <sir@cmpwn.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Combining -loadvm and -snapshot
Date: Tue, 12 Feb 2019 16:42:16 -0500	[thread overview]
Message-ID: <20190212214216.GA17279@homura.localdomain> (raw)

I recently ran into an issue where I found I couldn't combine the
-loadvm and -snapshot flags, nor any conceivable combination of
alternate approaches like loadvm via the monitor. Independently, both
options work as expected, but together I get this error:

qemu-system-x86_64: Device 'virtio0' does not have the requested snapshot 'base'

The goal here is to resume the VM state from a snapshot, but to prevent
the guest from persisting writes to the underlying qcow2.

I started digging into the code to understand this problem more, and I
was pretty deep in the weeds when I realized what the underlying problem
probably was and the kind of refactoring necessary to fix it - so I'm
here to touch base before moving any further.

I believe this happens because -snapshot creates a temporary qcow2
overlaid on top of the disk you're using, and this overlay does not have
any snapshots copied, nor does any of the snapshot reading code (e.g.
qcow2_snapshot_list or qcow2_snapshot_goto) iterate over backing disks
to load their snapshots.

At first I was going to adjust the qcow2 snapshot loading code (those
two functions in particular) to read through their backends, but I'm a
little unfamiliar with this code and the refactoring is not minor so I
would like to get feedback from some of the wiser folks on this mailing
list before I sink too much time into this.

Thoughts?

--
Drew DeVault

             reply	other threads:[~2019-02-12 21:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 21:42 Drew DeVault [this message]
2019-02-13  6:07 ` [Qemu-devel] Combining -loadvm and -snapshot Markus Armbruster
2019-02-13 10:46   ` Kevin Wolf
2019-02-13 14:05     ` Drew DeVault

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=20190212214216.GA17279@homura.localdomain \
    --to=sir@cmpwn.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).