Page MenuHomeFreeBSD

Add support for detecting with cfengine is running under Xen.
ClosedPublic

Authored by skreuzer on Nov 21 2016, 8:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 8:40 AM
Unknown Object (File)
Dec 2 2023, 7:17 AM
Unknown Object (File)
Oct 22 2023, 6:28 PM
Unknown Object (File)
Oct 7 2023, 11:47 AM
Unknown Object (File)
Sep 17 2023, 6:07 AM
Unknown Object (File)
Aug 16 2023, 4:05 PM
Unknown Object (File)
Jun 19 2023, 10:52 PM
Unknown Object (File)
Apr 12 2023, 8:43 AM
Subscribers

Details

Summary

It appears that detection of Xen environments is broken on Linux and
also gets compiled out due to overzealous use of linux ifdefs when compiling
on FreeBSD. This revision addresses upstream bug CFE-2203 which can be found
at https://tracker.mender.io/browse/CFE-2203.

Test Plan

Build a new package of cfengine39 on an AWS EC2 instance running
FreeBSD-11 and make sure cf-promises --show-classes shows xen specific classes
being defined

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 6028
Build 6294: arc lint + arc unit

Event Timeline

skreuzer retitled this revision from to Add support for detecting with cfengine is running under Xen..
skreuzer updated this object.
skreuzer edited the test plan for this revision. (Show Details)
skreuzer added reviewers: cy, gjb.

One other thing to mention is that I do plan to attempting to submit these changes back upstream but getting patches accepted into cfengine is both slow and frustrating. For now I think it is easier to maintain these patches in the port and hope that at some point in the future I can remove them.

Also, just as a reference this is the environment I was testing on

root@ip-172-31-53-252:~ # uname -a
FreeBSD ip-172-31-53-252 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r297692: Fri Apr  8 03:07:13 UTC 2016     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
root@ip-172-31-53-252:~ # sysctl -n kern.vm_guest
xen
root@ip-172-31-53-252:~ # /usr/local/sbin/cf-promises --show-classes | grep -i xen
xen                                                          inventory,attribute_name=Virtual host,source=agent,hardclass
xen_domu_hv                                         source=agent,hardclass

I am likely not the best person to review this, but I see no issue with it. I would defer to Cy on this, but if you have submitted a change request upstream, you're probably ok to commit this.

cy edited edge metadata.

Is there any value to backporting this to cfengine38?

This revision is now accepted and ready to land.Nov 22 2016, 2:13 PM