Closed dgdavid closed 3 years ago
:heavy_check_mark: Public Jenkins job #269 successfully finished :heavy_check_mark: Created OBS submit request #852036
:heavy_check_mark: Internal Jenkins job #135 successfully finished :heavy_check_mark: Created IBS submit request #231767
Problem
yast-kdump started warning the user when running on a Xen HVM guest.
https://bugzilla.suse.com/show_bug.cgi?id=1179197 https://trello.com/c/uqdMdM0n/2198-sles15-sp3-p2-1179197-build-20140-kdump-not-supported-in-xen-hvm
Real problem
According to https://bugzilla.suse.com/show_bug.cgi?id=952253#c8, yast-kdump must alert the user when running in a Xen PV guest
However, yast-kdump is relying in
Yast::Arch
, which was fixed a few months ago because a broken detection of both, dom0 and domU (see https://bugzilla.opensuse.org/show_bug.cgi?id=1172742). Looking at the former code base, it was using/proc/xen/xsd_port
for determining if running in a host or guest, and wrongly returning host when executing the code in a XEN HVM domU.Proposed solution
This PR proposes having a method to know if the code is running in a paravirtualized Xen guest, using the information available in
/sys/hypervisor/guest_type
.Notes
Back in the times, @ancorgs implemented the requested check in https://bugzilla.suse.com/show_bug.cgi?id=952253#c8, but it was discarded in favor of
Yast::Arch#is_xenU
before merging it. I have been evaluating to bring back those lines of code but I think that reading/sys/hypervisor/guest_type
is reliable and less complicated.More information
For more information about the Xen detection, please read the description of https://github.com/yast/yast-yast2/pull/1062. Additionally, Martin Loviska's commented about
xen-detect
binary, which returns hypervisor type with version detected from the domain, but I'm not sure if it is available by default.