Created attachment 163452 [details] enable xe-daemon by default By default the xenguest_enable is not set, but this daemon is used to enhance capability XenCenter to guest VM, for example reboot/shutdown/suspend. So people compiled xe-guest-utilities, he/she might want it to enhance XenCenter. Herefore we need to make it enabled by default. On the contrary, if someone doesn't want it on the OS compiled with xe-guest-utilities, set the xenguest_enable=NO to rc.conf. In this patch, I used sysctl to detect the variable kern.vm_guest if it is runnong on Xen.
Fix the title, and cc maintainer: dinoex@FreeBSD.org
is kern.vm_guest available on all supported FreeBSD versions?
patch not approved. I see a some problems. 1) the detection does not need >/dev/null, you may use "grep -q" 2) The grep xen does not match the community edition. 3) please explain the benefit of [ -z "$xenguest_enable" ] && xenguest_enable="YES" instead of plain: : ${xenguest_enable:=YES}
(In reply to Dirk Meyer from comment #3) 1) the detection does not need >/dev/null, you may use "grep -q" Yes, 'grep -q' is better. 2) The grep xen does not match the community edition. I tested it on XenServer 6.5, and I don't have a community edition Xen. The kern.vm_guest is added from 2008-12, http://www.archivum.info/svn-src-all@freebsd.org/2008-12/00515/index.html From the file sys/kern/subr_param.c, the vm_guest_sysctl_names should be Xen, none, generic, or hv. Do you know what is the content of kern.vm_guest on community edition Xen? If it is generic? 3) please explain the benefit of '[ -z "$xenguest_enable" ] && xenguest_enable="YES"' It has the same effect of ': ${xenguest_enable:=YES}', but it is more complex. So I think ': ${xenguest_enable:=YES}' is better.
A commit references this bug: Author: dinoex Date: Sun Jan 10 07:30:40 UTC 2016 New revision: 405675 URL: https://svnweb.freebsd.org/changeset/ports/405675 Log: - enable autostart when xen is detected PR: 204763 Changes: head/sysutils/xe-guest-utilities/Makefile head/sysutils/xe-guest-utilities/files/xenguest.in
Commited a shell only version.