Martin Polednik has uploaded a new change for review.
Change subject: caps: add fake emulated machines ......................................................................
caps: add fake emulated machines
When running fakekvm, the libvirt capability XML doesn't contain emulated machine types of the opposite architecture. When adding such host to engine, it will be considered non-operational. The patch hardcodes the emulated machine types of both architectures and returns them, causing the engine to accept the host.
Change-Id: I707515225b9034adda1770870d9a6939ecca9e5d Signed-off-by: Martin Polednik mpolednik@redhat.com --- M vdsm/caps.py 1 file changed, 24 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/46852/1
diff --git a/vdsm/caps.py b/vdsm/caps.py index fed29f1..a3c1f16 100644 --- a/vdsm/caps.py +++ b/vdsm/caps.py @@ -381,6 +381,27 @@ return AutoNumaBalancingStatus.UNKNOWN
+def _get_fake_emulated_machines(): + ppc64le_machines = ['pseries', 'pseries-rhel7.2.0'] + x86_64_machines = ['pc-i440fx-rhel7.1.0', + 'rhel6.3.0', + 'pc-q35-rhel7.2.0', + 'pc-i440fx-rhel7.0.0', + 'rhel6.1.0', + 'rhel6.6.0', + 'rhel6.2.0', + 'pc', + 'pc-q35-rhel7.0.0', + 'pc-q35-rhel7.1.0', + 'q35', + 'pc-i440fx-rhel7.2.0', + 'rhel6.4.0', + 'rhel6.0.0', + 'rhel6.5.0'] + + return ppc64le_machines + x86_64_machines + + def _get_emulated_machines_from_node(node): # We have to make sure to inspect 'canonical' attribute where # libvirt puts the real machine name. Relevant bug: @@ -417,6 +438,9 @@
@utils.memoized def _getEmulatedMachines(arch, capabilities=None): + if config.getboolean('vars', 'fake_kvm_support'): + return _get_fake_emulated_machines() + if capabilities is None: capabilities = _getCapsXMLStr() caps = ET.fromstring(capabilities)