qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>,
	ben@skyportsystems.com, qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH v8 4/8] ACPI: Add Virtual Machine Generation ID support
Date: Mon, 20 Feb 2017 12:38:06 +0100	[thread overview]
Message-ID: <1b2ce22b-3085-af08-332c-9519322b207e@redhat.com> (raw)
In-Reply-To: <20170220110014.GD2372@work-vm>

On 02/20/17 12:00, Dr. David Alan Gilbert wrote:
> * Laszlo Ersek (lersek@redhat.com) wrote:
>> On 02/20/17 11:23, Dr. David Alan Gilbert wrote:
>>> * Laszlo Ersek (lersek@redhat.com) wrote:
>>>> CC Dave
>>>
>>> This isn't an area I really understand; but if I'm
>>> reading this right then 
>>>    vmgenid is stored in fw_cfg?
>>>    fw_cfg isn't migrated
>>>
>>> So why should any changes to it get migrated, except if it's already
>>> been read by the guest (and if the guest reads it again aftwards what's
>>> it expected to read?)
>>
>> This is what we have here:
>> - QEMU formats read-only fw_cfg blob with GUID
>> - guest downloads blob, places it in guest RAM
>> - guest tells QEMU the guest-side address of the blob
>> - during migration, guest RAM is transferred
>> - after migration, in the device's post_load callback, QEMU overwrites
>>   the GUID in guest RAM with a different value, and injects an SCI
>>
>> I CC'd you for the following reason: Igor reported that he didn't see
>> either the fresh GUID or the SCI in the guest, on the target host, after
>> migration. I figured that perhaps there was an ordering issue between
>> RAM loading and post_load execution on the target host, and so I
>> proposed to delay the RAM overwrite + SCI injection a bit more;
>> following the pattern seen in your commit 90c647db8d59.
>>
>> However, since then, both Ben and myself tested the code with migration
>> (using "virsh save" (Ben) and "virsh managedsave" (myself)), with
>> Windows and Linux guests, and it works for us; there seems to be no
>> ordering issue with the current code (= overwrite RAM + inject SCI in
>> the post_load callback()).
>>
>> For now we don't understand why it doesn't work for Igor (Igor used
>> exec/gzip migration to/from a local file using direct QEMU monitor
>> commands / options, no libvirt). And, copying the pattern seen in your
>> commit 90c647db8d59 didn't help in his case (while it wasn't even
>> necessary for success in Ben's and my testing).
> 
> One thing I noticed in Igor's test was that he did a 'stop' on the source
> before the migate, and so it's probably still paused on the destination
> after the migration is loaded, so anything the guest needs to do might
> not have happened until it's started.

Interesting! I hope Igor can double-check this!

In the virsh docs, before doing my tests, I read that "managedsave"
optionally took --running or --paused:

    Normally, starting a managed save will decide between running or
    paused based on the state the domain was in when the save was done;
    passing either the --running or --paused flag will allow overriding
    which state the start should use.

I didn't pass any such flag ultimately, and I didn't stop the guests
before the managedsave. Indeed they continued execution right after
being loaded with "virsh start".

(Side point: managedsave is awesome. :) )

> 
> You say;
>    'guest tells QEMU the guest-side address of the blob'
> how is that stored/migrated/etc ?

It is a uint8_t[8] array (little endian representation), linked into
another (writeable) fw_cfg entry, and it's migrated explicitly (it has a
descriptor in the device's vmstate descriptor). The post_load callback
relies on this array being restored before the migration infrastructure
calls post_load.

Thanks
Laszlo

  reply	other threads:[~2017-02-20 11:38 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 23:15 [Qemu-devel] [PATCH v8 0/8] Add support for VM Generation ID ben
2017-02-16 23:15 ` [Qemu-devel] [PATCH v8 1/8] linker-loader: Add new 'write pointer' command ben
2017-02-16 23:15 ` [Qemu-devel] [PATCH v8 2/8] docs: VM Generation ID device description ben
2017-02-16 23:15 ` [Qemu-devel] [PATCH v8 3/8] ACPI: Add vmgenid blob storage to the build tables ben
2017-02-16 23:15 ` [Qemu-devel] [PATCH v8 4/8] ACPI: Add Virtual Machine Generation ID support ben
2017-02-17 10:43   ` Igor Mammedov
2017-02-17 12:50     ` Laszlo Ersek
2017-02-17 13:05       ` Igor Mammedov
2017-02-17 13:41         ` Laszlo Ersek
2017-02-20 10:23       ` Dr. David Alan Gilbert
2017-02-20 10:40         ` Laszlo Ersek
2017-02-20 11:00           ` Dr. David Alan Gilbert
2017-02-20 11:38             ` Laszlo Ersek [this message]
2017-02-20 12:32               ` Dr. David Alan Gilbert
2017-02-20 15:35                 ` Laszlo Ersek
2017-02-20 13:13               ` Igor Mammedov
2017-02-20 13:28                 ` Laszlo Ersek
2017-02-20 14:40                   ` Igor Mammedov
2017-02-20 20:00         ` Eric Blake
2017-02-20 20:19           ` Dr. David Alan Gilbert
2017-02-20 20:45             ` Eric Blake
2017-02-20 20:55               ` Laszlo Ersek
2017-02-21  1:43                 ` Michael S. Tsirkin
2017-02-21  9:58                   ` Laszlo Ersek
2017-02-21 14:14                     ` Michael S. Tsirkin
2017-02-21 16:08                       ` Laszlo Ersek
2017-02-21 16:17                         ` Michael S. Tsirkin
2017-02-21 16:50                           ` Laszlo Ersek
2017-02-20 20:49             ` Laszlo Ersek
2017-02-17 15:33     ` Ben Warren
2017-02-17 16:03       ` Laszlo Ersek
2017-02-17 18:34         ` Ben Warren
2017-02-17 19:00           ` Michael S. Tsirkin
2017-02-17 20:42           ` Laszlo Ersek
2017-02-17 20:07         ` Laszlo Ersek
2017-02-18  0:15           ` Ben Warren
2017-02-16 23:15 ` [Qemu-devel] [PATCH v8 5/8] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands ben
2017-02-16 23:15 ` [Qemu-devel] [PATCH v8 6/8] tests: Move reusable ACPI code into a utility file ben
2017-02-20 14:49   ` Igor Mammedov
2017-02-16 23:15 ` [Qemu-devel] [PATCH v8 7/8] tests: Add unit tests for the VM Generation ID feature ben
2017-02-20 14:49   ` Igor Mammedov
2017-04-21 10:14     ` Marc-André Lureau
2017-04-21 17:59       ` Ben Warren
2017-04-24 12:28         ` Laszlo Ersek
2017-02-16 23:15 ` [Qemu-devel] [PATCH v8 8/8] MAINTAINERS: Add VM Generation ID entries ben
2017-02-20 14:50   ` Igor Mammedov
2017-02-20 14:57 ` [Qemu-devel] [PATCH v8 0/8] Add support for VM Generation ID Igor Mammedov
2017-02-20 15:41   ` Laszlo Ersek
2017-02-20 15:45     ` Kevin O'Connor
2017-02-20 16:00       ` Laszlo Ersek
2017-02-21  7:10       ` Gerd Hoffmann
2017-02-20 18:10     ` Ben Warren
2017-02-21 12:20   ` Laszlo Ersek

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=1b2ce22b-3085-af08-332c-9519322b207e@redhat.com \
    --to=lersek@redhat.com \
    --cc=ben@skyportsystems.com \
    --cc=dgilbert@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.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).