From: Ian Campbell <ian.campbell@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
wei.liu2@citrix.com, Konrad Rzeszutek Wilk <konrad@darnok.org>,
ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH for-4.6 v2] tools/hotplug: Add an initscript to start "xl devd" in a driver domain
Date: Mon, 20 Jul 2015 15:28:48 +0100 [thread overview]
Message-ID: <1437402528.17368.36.camel@citrix.com> (raw)
In-Reply-To: <55AD02DA.4050004@citrix.com>
On Mon, 2015-07-20 at 16:16 +0200, Roger Pau Monné wrote:
> El 16/07/15 a les 18.58, Ian Campbell ha escrit:
> > The removal of the udev rules highlighted that although it has been
> > replaced by "xl devd" there isn't an initscript to replace it.
> >
> > To enable this add a --pidfile option to xl devd.
> >
> > Tested on Linux by running the script in dom0 and checking the daemon
> > was started/stopped, but not in an actual driver domain environment
> > since I don't have one conveniently available. I also checked that
> > running without the --pidfile option still works.
> >
> > Scripts mainly cribbed from the xencommons for each platform.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Roger Pau Monné <roger.pau@citrix.com>
> > Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
> > Cc: George Dunlap <george.dunlap@eu.citrix.com>
> > ---
> > For 4.6: I think having removed the udev rules we ought to include
> > this, it's basically zero risk to normal operation.
> >
> > Nothing seems to start xl devd for domain 0 in *BSD, nor is xenbackend
> > started. Is that correct?
> >
> > v2: Check in Linux script that we don't start on dom0. I don't know
> > the equivalent for *BSD.
>
> At least on FreeBSD there's no easy way to know if we are running on
> Dom0 from userspace (unless we start using hypercalls with privcmd).
>
> I could add a dummy device (let's say /dev/xen/control) that's only
> present if we are running on Dom0, does that sound reasonable?
FWIW on Linux there is a capabilities "device" (actually procfs thing,
close enough) which contains "control_d" in dom0. Not sure if that is
helpful to follow?
> Another option would be to add a small C program that can use hypercalls
> and privcmd to detect if we are running on Dom0 or not, but that seems
> over engineering it.
Agreed.
> [...]
>
> > diff --git a/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
> > new file mode 100644
> > index 0000000..25e3edd
> > --- /dev/null
> > +++ b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
> > @@ -0,0 +1,48 @@
> > +#!/bin/sh
> > +#
> > +# PROVIDE: xendriverdomain
> > +# REQUIRE: DAEMON
> > +#
> > +# Should be run in a driver domain, but not in domain 0.
> > +
> > +. /etc/rc.subr
> > +
> > +. /etc/xen/scripts/hotplugpath.sh
>
> This should have been:
>
> . @XEN_SCRIPT_DIR@/hotplugpath.sh
>
> I will send a patch ASAP to fix it.
Sorry, and please do, thanks.
> [...]
> > + if ( close(fd) < 0 ) {
>
> <pedantic>
> The line above doesn't follow libxl coding style.
> </pedantic>
Damn, sorry.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-07-20 14:28 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 10:51 [PATCH 0/6] Use system blktap George Dunlap
2015-07-06 10:51 ` [PATCH 1/6] libxl: Make local_initiate_attach more rational George Dunlap
2015-07-06 10:51 ` [PATCH 2/6] libxl: Remove linux udev rules George Dunlap
2015-07-07 11:39 ` Wei Liu
2015-07-14 16:13 ` Konrad Rzeszutek Wilk
2015-07-14 16:21 ` Ian Campbell
2015-07-14 16:35 ` George Dunlap
2015-07-14 16:40 ` Wei Liu
2015-07-14 16:48 ` Ian Campbell
2015-07-23 11:55 ` Roger Pau Monné
2015-07-23 12:30 ` Ian Campbell
2015-07-15 11:07 ` [PATCH for-4.6] tools/hotplug: Add an initscript to start "xl devd" in a driver domain Ian Campbell
2015-07-15 13:26 ` Wei Liu
2015-07-15 13:40 ` Ian Campbell
2015-07-15 15:25 ` George Dunlap
2015-07-15 15:32 ` Ian Jackson
2015-07-15 15:35 ` George Dunlap
2015-07-15 15:37 ` Ian Campbell
2015-07-16 16:58 ` [PATCH for-4.6 v2] " Ian Campbell
2015-07-16 17:09 ` Ian Jackson
2015-07-16 17:48 ` Wei Liu
2015-07-17 9:05 ` Wei Liu
2015-07-17 11:36 ` Ian Campbell
2015-07-20 14:16 ` Roger Pau Monné
2015-07-20 14:28 ` Ian Campbell [this message]
2015-07-06 10:51 ` [PATCH 3/6] tools: Add a block-tap script for setting up tapdisks via tap-ctl George Dunlap
2015-07-07 12:03 ` Wei Liu
2015-07-07 12:35 ` Wei Liu
2015-07-06 10:51 ` [PATCH 4/6] libxl: Use the block-tap script for LIBXL_DISK_BACKEND_TAP George Dunlap
2015-07-06 11:01 ` Andrew Cooper
2015-07-06 12:39 ` George Dunlap
2015-07-07 12:29 ` Wei Liu
2015-07-07 13:41 ` George Dunlap
2015-07-07 14:20 ` Ian Campbell
2015-07-07 14:27 ` George Dunlap
2015-07-06 10:51 ` [PATCH 5/6] tools: Remove in-tree blktap2 George Dunlap
2015-07-07 11:55 ` Wei Liu
2015-07-06 10:51 ` [PATCH 6/6] libxl: Add more logging to hotplug script path George Dunlap
2015-07-07 11:55 ` Wei Liu
2015-07-07 14:21 ` [PATCH 0/6] Use system blktap Ian Campbell
2015-07-07 14:24 ` George Dunlap
2015-07-07 14:52 ` Ian Campbell
2015-07-07 14:59 ` George Dunlap
2015-07-07 15:04 ` Ian Campbell
2015-07-07 15:20 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437402528.17368.36.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=konrad@darnok.org \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).