spapr: Validate capabilities on migration
commitbe85537d654565e35e359a74b46fc08b7956525c
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 11 Dec 2017 04:09:37 +0000 (11 15:09 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 16 Jan 2018 22:35:24 +0000 (17 09:35 +1100)
tree4b3a596fa2b1a8ca09778277035fe4f26365a7e1
parentee76a09fc72cfbfab2bb5529320ef7e460adffd8
spapr: Validate capabilities on migration

Now that the "pseries" machine type implements optional capabilities (well,
one so far) there's the possibility of having different capabilities
available at either end of a migration.  Although arguably a user error,
it would be nice to catch this situation and fail as gracefully as we can.

This adds code to migrate the capabilities flags.  These aren't pulled
directly into the destination's configuration since what the user has
specified on the destination command line should take precedence.  However,
they are checked against the destination capabilities.

If the source was using a capability which is absent on the destination,
we fail the migration, since that could easily cause a guest crash or other
bad behaviour.  If the source lacked a capability which is present on the
destination we warn, but allow the migration to proceed.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
hw/ppc/spapr.c
hw/ppc/spapr_caps.c
include/hw/ppc/spapr.h