From: Laszlo Ersek <lersek@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Juan Quintela <quintela@redhat.com>,
Michal Privoznik <mprivozn@redhat.com>,
David Gilbert <dgilbert@redhat.com>,
qemu devel list <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 0/2] pflash (UEFI varstore) migration shortcut for libvirt
Date: Wed, 27 Aug 2014 11:21:47 +0200 [thread overview]
Message-ID: <53FDA32B.8040709@redhat.com> (raw)
In-Reply-To: <20140827085832.GA15714@redhat.com>
On 08/27/14 10:58, Daniel P. Berrange wrote:
> On Sat, Aug 23, 2014 at 12:19:05PM +0200, Laszlo Ersek wrote:
>> Libvirt is growing support for x86_64 OVMF guests:
>>
>> http://www.redhat.com/archives/libvir-list/2014-August/msg01045.html
>>
>> An important feature of such guests is the persistent store for
>> non-volatile UEFI variables. This is implemented with if=pflash drives.
>> The referenced libvirt patchset sets up the varstore files for
>> single-host use.
>>
>> Wrt. migration, two choices have been considered:
>> (a) full-blown live storage migration for the drives backing pflash
>> devices,
>> (b) vs. a shortcut that exploits the special nature of pflash drives
>> (namely, their minuscule size, and a RAMBlock that keeps the full
>> contents of each pflash drive visible to the guest, and is
>> up-to-date, at all times.)
>
> So, IIUC, with option b), libvirt will merely need to make sure that
> the NVRAM var store file exists with the right size. QEMU will then
> just 'do the right thing' for migration copying across the contents ?
> If so that sounds nice to me.
Yes, that is the case.
Michal's patchset for libvirt pre-creates the empty varstore on the
incoming side, from the template file. That code path is shared with the
case when the VM starts up as a non-incoming one, and just has no
private varstore yet. The varstore created (from the template) is
"empty" in the PI / UEFI sense, but it's not all zeroes; it has some
internal structure.
Instantiating the VM-private varstore from the template is
- required for both size *and* contents reasons for a non-incoming
startup, and
- required for size reasons *only* for an incoming startup.
http://www.redhat.com/archives/libvir-list/2014-August/msg01048.html
+ /* If the nvram path is configured already, there's nothing
+ * we need to do. Unless we are starting the destination side
+ * of migration in which case nvram is configured in the
+ * domain XML but the file doesn't exist yet. Moreover, after
+ * the migration is completed, qemu will invoke a
+ * synchronization write into the nvram file so we don't have
+ * to take care about transmitting the real data on the other
+ * side. */
+ if (loader->nvram && !migrated)
+ return 0;
Once the pflash_post_load() hook is called in the incoming qemu process,
the VM-private varstore (which libvirt has prepared from the template)
will be completely overwritten by QEMU. But the size of the file is
important information, for starting up the incoming qemu side.
(Any mismatch in size would be caught when the backing RAMBlock's size
is verified during migration.)
Thanks
Laszlo
next prev parent reply other threads:[~2014-08-27 9:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-23 10:19 [Qemu-devel] [PATCH 0/2] pflash (UEFI varstore) migration shortcut for libvirt Laszlo Ersek
2014-08-23 10:19 ` [Qemu-devel] [PATCH 1/2] pflash_cfi01: fixup stale DPRINTF() calls Laszlo Ersek
2014-08-23 10:19 ` [Qemu-devel] [PATCH 2/2] pflash_cfi01: write flash contents to bdrv on incoming migration Laszlo Ersek
2014-08-25 10:33 ` [Qemu-devel] [PATCH 0/2] pflash (UEFI varstore) migration shortcut for libvirt Paolo Bonzini
2014-09-19 6:48 ` Alexey Kardashevskiy
2014-09-19 8:13 ` Paolo Bonzini
2014-08-27 8:58 ` Daniel P. Berrange
2014-08-27 9:21 ` Laszlo Ersek [this message]
2014-09-01 15:53 ` Stefan Hajnoczi
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=53FDA32B.8040709@redhat.com \
--to=lersek@redhat.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kwolf@redhat.com \
--cc=mprivozn@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
/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).