Martin Polednik has posted comments on this change.
Change subject: vdsm: introduce cpuinfo module
......................................................................
Patch Set 4:
(4 comments)
https://gerrit.ovirt.org/#/c/46912/4//COMMIT_MSG
Commit Message:
Line 9: The objective of the new module is encapsulating functionality related
Line 10: to CPU from bare-metal standpoint. That means parsing cpuinfo and
Line 11: exposing host architecture. This approach cleans up 'caps' module and,
Line 12: more importantly, moves the code to vdsm library - allowing hooks to
Line 13: work with cpu info and architecture.
so we can have fakekvm/fake* as hook, right? If so (excellent goal
BTW, we'
I've internally renamed fakekvm to fakearch (since that what it
really is), will do!
Line 14:
Line 15: Also adds tests for POWER8 cpuinfo and unknown architectures (should we
Line 16: encounter them).
Line 17:
https://gerrit.ovirt.org/#/c/46912/4/lib/vdsm/utils.py
File lib/vdsm/utils.py:
Line 808: if os.path.exists(constants.P_VDSM_NODE_ID):
Line 809: with open(constants.P_VDSM_NODE_ID) as f:
Line 810: __hostUUID = f.readline().replace("\n", "")
Line 811: else:
Line 812: if cpuinfo.arch() in (cpuinfo.Architecture.X86_64):
feel free to drop this if you don't like it.
nice idea!
still unsure of the call operator though :)
Line 813: ret, out, err = execCmd([constants.EXT_DMIDECODE,
Line 814: "-s",
Line 815: "system-uuid"],
Line 816: raw=True,
https://gerrit.ovirt.org/#/c/46912/4/tests/Makefile.am
File tests/Makefile.am:
Line 20:
Line 21: include $(top_srcdir)/build-aux/Makefile.subs
Line 22:
Line 23: SUBDIRS = \
Line 24: cpu\
cpuinfo maybe?
not sure about this part - I'd like to move
even the libvirt cpu-related output there
Line 25: functional \
Line 26: devices \
Line 27: integration \
Line 28: $(NULL)
https://gerrit.ovirt.org/#/c/46912/4/tests/cpuinfoTests.py
File tests/cpuinfoTests.py:
Line 33: @MonkeyPatch(platform, 'machine', lambda:
cpuinfo.Architecture.X86_64)
Line 34: def test_cpuinfo_E5649_x86_64(self):
Line 35: self._load_cpuinfo('cpuinfo_E5649_x86_64.out')
Line 36: self.assertEqual(set(cpuinfo.flags()),
Line 37: set('''fpu vme de pse tsc msr pae mce cx8
apic mtrr pge
if you're gonna using split(), why don't split this already
manually?
easy 'it was like that before' way, agreed that we shouldn't
be *that* lazy
Line 38: mca cmov pat pse36 clflush dts acpi mmx fxsr sse
Line 39: sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm
Line 40: constant_tsc arch_perfmon pebs bts rep_good
Line 41: xtopology nonstop_tsc aperfmperf pni pclmulqdq
--
To view, visit
https://gerrit.ovirt.org/46912
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaa702b05f3825ebdcfed16d86d39a8c38fcf224c
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: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes