Change in vdsm[master]: vdsm: move fake_kvm code into faqemu

fromani at redhat.com fromani at redhat.com
Wed Jan 27 13:39:48 UTC 2016


Francesco Romani has posted comments on this change.

Change subject: vdsm: move fake_kvm code into faqemu
......................................................................


Patch Set 23: Code-Review+2

(4 comments)

the hook could be improved more, but I think it is good enough and we should merge it unless real bugs come out.
Let's save polishing (after of course proper discussion and agreement) for later patches.

https://gerrit.ovirt.org/#/c/46897/23/vdsm_hooks/faqemu/after_get_caps.py
File vdsm_hooks/faqemu/after_get_caps.py:

Line 58:     print('\t-h, --help\t\tdisplay this help')
Line 59:     print('\t-t, --test\t\trun tests')
Line 60: 
Line 61: 
Line 62: def add_test():
testcase?
could be done in a later patch
Line 63:     '''
Line 64:     Method to register workaround test
Line 65:     '''
Line 66:     def workaround(function):


Line 71:         return wrapped
Line 72:     return workaround
Line 73: 
Line 74: 
Line 75: def _fake_caps_arch(caps, arch):
I'd move it at the top of the module, the layout of the code should preferably differentiate hook code and test code.
Line 76:     '''
Line 77:     Mutate 'caps' to act as an architecture set by fake_kvm_architecture
Line 78:     configuration option.
Line 79: 


Line 104:         caps['emulatedMachines'] = _PPC64LE_MACHINES
Line 105:         caps['cpuModel'] = 'POWER 8(fake)'
Line 106:         caps['cpuFlags'] = 'powernv,model_POWER8'
Line 107:     else:
Line 108:         raise cpuarch.UnsupportedArchitecture(arch)
please verify this case too.
Line 109: 
Line 110: 
Line 111: @add_test()
Line 112: def x86_64_test():


Line 141:     # not know which flags are added unless we query the host cpu.
Line 142:     if cpuarch.real() == cpuarch.X86_64:
Line 143:         expected_caps['cpuFlags'] = (','.join(set([
Line 144:             'vmx', 'sse2', 'nx'] + cpuinfo.flags())) +
Line 145:             expected_caps['cpuFlags'])
maybe (perhaps in a later patch) just make sure than both expected_caps and real caps share a common subset of cpuFlags?

a little more work but better than duplication.
Line 146: 
Line 147:     _fake_caps_arch(caps, cpuarch.X86_64)
Line 148: 
Line 149:     return caps == expected_caps


-- 
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: 23
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list