Bug 204763 - sysutils/xe-guest-utilities: Enable xe-daemon by default
Summary: sysutils/xe-guest-utilities: Enable xe-daemon by default
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dirk Meyer
Keywords: easy, needs-qa, patch
Depends on:
Reported: 2015-11-23 10:08 UTC by Jincheng Miao
Modified: 2016-01-10 09:29 UTC (History)
1 user (show)

See Also:
koobs: merge-quarterly?

enable xe-daemon by default (963 bytes, patch)
2015-11-23 10:08 UTC, Jincheng Miao
koobs: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jincheng Miao 2015-11-23 10:08:15 UTC
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.
Comment 1 Jincheng Miao 2015-11-23 10:11:55 UTC
Fix the title, and cc maintainer: dinoex@FreeBSD.org
Comment 2 Dirk Meyer freebsd_committer 2015-12-12 22:53:47 UTC
is kern.vm_guest available on all supported FreeBSD versions?
Comment 3 Dirk Meyer freebsd_committer 2015-12-14 14:36:17 UTC
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}
Comment 4 Jincheng Miao 2015-12-15 06:06:21 UTC
(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.
Comment 5 commit-hook freebsd_committer 2016-01-10 07:31:08 UTC
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

  - enable autostart when xen is detected
  PR:		204763

Comment 6 Dirk Meyer freebsd_committer 2016-01-10 09:28:30 UTC
Commited a shell only version.