Francesco Romani has posted comments on this change.
Change subject: vdsm: isolate fake_kvm into a hook
......................................................................
Patch Set 4: Code-Review+1
(3 comments)
looks good, only few comments/questions inside
https://gerrit.ovirt.org/#/c/46897/4/vdsm_hooks/fakearch/after_get_caps.py
File vdsm_hooks/fakearch/after_get_caps.py:
Line 45: 'rhel6.4.0',
Line 46: 'rhel6.0.0',
Line 47: 'rhel6.5.0']
Line 48:
Line 49: return ppc64le_machines + x86_64_machines
why not just one constant per arch?
_PPC64_LE_MACHINES = [...]
_X86_64_MACHINES = [...]
or maybe a dict whose keys are the supported arches.
Line 50:
Line 51:
Line 52: if __name__ == '__main__':
Line 53: if config.getboolean('vars', 'fake_kvm_support'):
Line 54: caps = hooking.read_json()
Line 55: arch = config.get('vars', 'fake_kvm_architecture')
Line 56:
Line 57: caps['kvmEnabled'] = str(config.getboolean('vars',
'fake_kvm_support'))
Line 58: caps['emulatedMachines'] = _get_fake_emulated_machines()
I don't think we need _get_fake_emulated_machines() function
Line 59:
Line 60: if arch == 'x86_64':
Line 61: caps['cpuModel'] = 'Intel(Fake) CPU'
Line 62:
Line 69:
Line 70: caps['cpuFlags'] = ','.join(flags) +
',model_486,model_pentium,' \
Line 71: 'model_pentium2,model_pentium3,model_pentiumpro,' \
Line 72: 'model_qemu32,model_coreduo,model_core2duo,model_n270,'
\
Line 73:
'model_Conroe,model_Penryn,model_Nehalem,model_Opteron_G1'
for a future patch/version (if you have time): let's make this string a list/tuple of
flags.
Line 74: elif arch in ('ppc64le', 'ppc64', 'ppc'):
Line 75: caps['cpuModel'] = 'POWER 8(fake)'
Line 76: caps['cpuFlags'] = 'powernv,model_POWER8'
Line 77: else:
--
To view, visit
https://gerrit.ovirt.org/46897
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I178e0c1d5a9a8ffca2bf28b2fb404b42729dfff4
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes