]> git.proxmox.com Git - mirror_qemu.git/commit
hw/ppc/spapr_caps: Rework spapr_caps to use uint8 internal representation
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Fri, 12 Jan 2018 05:33:43 +0000 (16:33 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 16 Jan 2018 22:35:24 +0000 (09:35 +1100)
commit4e5fe3688e23d61b45cc549ff1322aff8f50ef45
tree79fac90a82477231956cee7d1c4b760a3fa9860a
parent2d1fb9bc8e6e78931d8e1bfeb0ed7a4d223b0480
hw/ppc/spapr_caps: Rework spapr_caps to use uint8 internal representation

Currently spapr_caps are tied to boolean values (on or off). This patch
reworks the caps so that they can have any uint8 value. This allows more
capabilities with various values to be represented in the same way
internally. Capabilities are numbered in ascending order. The internal
representation of capability values is an array of uint8s in the
sPAPRMachineState, indexed by capability number.

Capabilities can have their own name, description, options, getter and
setter functions, type and allow functions. They also each have their own
section in the migration stream. Capabilities are only migrated if they
were explictly set on the command line, with the assumption that
otherwise the default will match.

On migration we ensure that the capability value on the destination
is greater than or equal to the capability value from the source. So
long at this remains the case then the migration is considered
compatible and allowed to continue.

This patch implements generic getter and setter functions for boolean
capabilities. It also converts the existings cap-htm, cap-vsx and
cap-dfp capabilities to this new format.

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