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 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.