xcp-ng / xcp-ng-xapi-plugins

XCP-ng's specific XAPI plugins
GNU Affero General Public License v3.0
6 stars 9 forks source link

add detection of hyperthreading in dom0 #6

Closed nraynaud closed 5 years ago

nraynaud commented 5 years ago

linked to https://github.com/vatesfr/xen-orchestra/issues/4262

johnelse commented 5 years ago

FYI, given a host, you can already get the hyperthreading CPU flag via the XenAPI - something like this:

hyperthreading = False

cpus = session.xenapi.host.get_host_CPUs(host)
if len(cpus) > 0:
    flags = session.xenapi.host_cpu.get_flags(cpus[0])
    hyperthreading = 'ht' in flags.split(' ')
nraynaud commented 5 years ago

The linked bug has a lengthy discussion explaining that this is not reliable.

Envoyé de mon iPhone

Le 10 juin 2019 à 18:25, John Else notifications@github.com a écrit :

FYI you can already get the hyperthreading CPU flag via the XenAPI - something like this:

hyperthreading = False

cpus = session.xenapi.host.get_host_CPUs(host) if len(cpus) > 0: flags = session.xenapi.host_cpu.get_flags(cpus[0]) hyperthreading = 'ht' in flags.split(' ') — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

johnelse commented 5 years ago

Apologies, as you were then :)

stormi commented 5 years ago

Looks good

stormi commented 5 years ago

xcp-ng-xapi-plugins-1.3.0-2.xcpng8.0 pushed to 8.0/xcp-ng-base RPM repository.