qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 11/11] test-vmstate: add test case to verify


From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [PATCH 11/11] test-vmstate: add test case to verify we don't change VMState
Date: Wed, 23 Mar 2011 12:01:32 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

On 03/23/2011 11:45 AM, Peter Maydell wrote:
On 23 March 2011 16:27, Anthony Liguori<address@hidden>  wrote:
Migration uses the VMStateDescription name as a section identifier.  The
section identifiers MUST be unique for a given device.  Otherwise, if both
devices are present, migration fails miserably.
So how does it work if you have two devices of the same type
in the system? I'd assumed that the unique identifier would
be one based on the actually instantiated devices.

It's a combination of the section name + a device instance ID that has some magic behind making it unique and stable. But instance ID is not unique on it's own.

  It also means that if the
wrong devices are created on the destination, instead of predictable
failure, you get unpredictable guest corruption.

The Right Way to support what you're describing above is to have a single
VMStateField array and two VMStateDescriptions.  IOW:
This doesn't make sense because it's decoupling the information
about minimum version ID etc (in the VMStateDescription) from
the information about which fields are in which version (which
is in the VMStateField array when it's initialised via
VMSTATE_*_V() macros). So although you get to avoid duplicating
all the fields in the arrangement you suggest you still end
up with version_id, minimum_version_id etc being duplicated
and needing to stay in sync.

So maybe we just need to remove name from VMStateDescription and force it to come from DeviceInfo.

Regards,

Anthony Liguori

-- PMM





reply via email to

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