<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - systemd-detect-virt and directive ConditionVirtualization wrongly return vm for xen dom0"
href="https://bugs.freedesktop.org/show_bug.cgi?id=77271#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - systemd-detect-virt and directive ConditionVirtualization wrongly return vm for xen dom0"
href="https://bugs.freedesktop.org/show_bug.cgi?id=77271">bug 77271</a>
from <span class="vcard"><a class="email" href="mailto:andy.melnikov@gmail.com" title="Andy Melnikov <andy.melnikov@gmail.com>"> <span class="fn">Andy Melnikov</span></a>
</span></b>
<pre>That page seems to be wrong/outdated/incomplete: dmidecode won't work on Xen PV
systems as there's no DMI emulation there, /proc/xen/capabilities doesn't
always exist, and kernel suffix is unreliable as one can put anything there.
I think we should leave old Xen detection code using /sys/hypervisor/type and
only add a distinction between xen dom0 and domU using the method proposed in
the new patch. In pseudocode:
if (/sys/hypervisor/type == 'xen')
{
# we run Xen, and only need to distinguish between dom0 and domU
if (exists /proc/xen/capabilities &&
/proc/xen/capabilities contains 'control_d')
{
return 'xen-dom0'
}
else
{
return 'xen-domU'
}
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>