s390x: return unavailable features via query-cpu-definitions
commit38cba1f4d83525e728719d7ac6e9551cddfadee6
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Mon, 3 Jul 2017 11:48:49 +0000 (3 13:48 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 5 Jul 2017 17:44:24 +0000 (5 19:44 +0200)
treecc60193dc121839709faf15fc220a1c56b683ddb
parentc1976ae7a291956ba3d79228150e4c1d21f5d998
s390x: return unavailable features via query-cpu-definitions

The response for query-cpu-definitions didn't include the
unavailable-features field, which is used by libvirt to figure
out whether a certain cpu model is usable on the host.

The unavailable features are now computed by obtaining the host CPU
model and comparing it against the known CPU models. The comparison
takes into account the generation, the GA level and the feature
bitmaps. In the case of a CPU generation/GA level mismatch
a feature called "type" is reported to be missing.

As a result, the output of virsh domcapabilities would change
from something like
 ...
     <mode name='custom' supported='yes'>
      <model usable='unknown'>z10EC-base</model>
      <model usable='unknown'>z9EC-base</model>
      <model usable='unknown'>z196.2-base</model>
      <model usable='unknown'>z900-base</model>
      <model usable='unknown'>z990</model>
 ...
to
 ...
     <mode name='custom' supported='yes'>
      <model usable='yes'>z10EC-base</model>
      <model usable='yes'>z9EC-base</model>
      <model usable='no'>z196.2-base</model>
      <model usable='yes'>z900-base</model>
      <model usable='yes'>z990</model>
 ...

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Message-Id: <1499082529-16970-1-git-send-email-mihajlov@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
target/s390x/cpu_models.c