Bastian Blank
2010-May-26 10:51 UTC
[Xen-devel] Name of event-channel and other devices vs. udev
Hi Currently udev overwrites the name of the event-channel device to /dev/xen/evtchn. This approach is about to be discontinued and needs to be fixed on either side. | udevd-work[549]: kernel-provided name ''evtchn'' and NAME= ''xen/evtchn'' disagree, please use SYMLINK+= or change the kernel to provide the proper name There are several fixes for that: - Make the kernel name the device "xen/evtchn". - Remove the rule and convert to another name. Either /dev/evtchn, which is a bit to generic or something like xen-evtchn. The first should be the more compatible one. Bastian -- A princess should not be afraid -- not with a brave knight to protect her. -- McCoy, "Shore Leave", stardate 3025.3 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2010-May-27 00:08 UTC
[Xen-devel] Re: Name of event-channel and other devices vs. udev
On 05/26/2010 03:51 AM, Bastian Blank wrote:> Hi > > Currently udev overwrites the name of the event-channel device to > /dev/xen/evtchn. This approach is about to be discontinued and needs to > be fixed on either side. > > | udevd-work[549]: kernel-provided name ''evtchn'' and NAME= ''xen/evtchn'' disagree, please use SYMLINK+= or change the kernel to provide the proper name > > There are several fixes for that: > - Make the kernel name the device "xen/evtchn". > - Remove the rule and convert to another name. Either /dev/evtchn, which > is a bit to generic or something like xen-evtchn. > > The first should be the more compatible one. >Yep, looks reasonable to me. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bastian Blank
2010-May-27 07:35 UTC
Re: [Xen-devel] Name of event-channel and other devices vs. udev
On Wed, May 26, 2010 at 12:51:44PM +0200, Bastian Blank wrote:> Currently udev overwrites the name of the event-channel device to > /dev/xen/evtchn. This approach is about to be discontinued and needs to > be fixed on either side. > There are several fixes for that: > - Make the kernel name the device "xen/evtchn".This approach somewhat reliable failed for me[1]. Also nothing else in the kernel uses it. So I assume this is not really supported.> - Remove the rule and convert to another name. Either /dev/evtchn, which > is a bit to generic or something like xen-evtchn.So this is the only solution, and the kernel usually uses _ as delimiter for devices, so "xen_evtchn" is the name to use. And make xen/evtchn a symlink for backward compatibility. Bastian [1]: http://bugs.debian.org/583283 -- Conquest is easy. Control is not. -- Kirk, "Mirror, Mirror", stardate unknown _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bastian Blank
2010-May-27 14:31 UTC
Re: [Xen-devel] Name of event-channel and other devices vs. udev
On Thu, May 27, 2010 at 09:35:12AM +0200, Bastian Blank wrote:> On Wed, May 26, 2010 at 12:51:44PM +0200, Bastian Blank wrote: > > - Make the kernel name the device "xen/evtchn". > This approach somewhat reliable failed for me[1]. Also nothing else in > the kernel uses it. So I assume this is not really supported.Xen themself is responsible for this behaviour.> [1]: http://bugs.debian.org/583283Bastian -- I''m a soldier, not a diplomat. I can only tell the truth. -- Kirk, "Errand of Mercy", stardate 3198.9 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bastian Blank
2010-May-27 15:02 UTC
[Xen-devel] [PATCH] Fix name of Xen event-channel device
The Xen event-channel device is named evtchn in the kernel but always used as /dev/xen/evtchn in userspace. This patch fixes the name. Signed-off-by: Bastian Blank <waldi@debian.org> diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c index 66e185c..89cd743 100644 --- a/drivers/xen/evtchn.c +++ b/drivers/xen/evtchn.c @@ -471,7 +471,7 @@ static const struct file_operations evtchn_fops = { static struct miscdevice evtchn_miscdev = { .minor = MISC_DYNAMIC_MINOR, - .name = "evtchn", + .name = "xen/evtchn", .fops = &evtchn_fops, }; static int __init evtchn_init(void) -- Yes, it is written. Good shall always destroy evil. -- Sirah the Yang, "The Omega Glory", stardate unknown _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2010-May-27 16:26 UTC
Re: [Xen-devel] [PATCH] Fix name of Xen event-channel device
On Thu, May 27, 2010 at 05:02:51PM +0200, Bastian Blank wrote:> The Xen event-channel device is named evtchn in the kernel but always > used as /dev/xen/evtchn in userspace. This patch fixes the name.Hey Bastian, Is this related to this bug: http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1612 ? I saw it in some reference to the evtchn but wasn''t sure if this is the same.> > Signed-off-by: Bastian Blank <waldi@debian.org> > > diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c > index 66e185c..89cd743 100644 > --- a/drivers/xen/evtchn.c > +++ b/drivers/xen/evtchn.c > @@ -471,7 +471,7 @@ static const struct file_operations evtchn_fops = { > > static struct miscdevice evtchn_miscdev = { > .minor = MISC_DYNAMIC_MINOR, > - .name = "evtchn", > + .name = "xen/evtchn", > .fops = &evtchn_fops, > }; > static int __init evtchn_init(void) > -- > Yes, it is written. Good shall always destroy evil. > -- Sirah the Yang, "The Omega Glory", stardate unknown > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Michael Tokarev
2010-May-27 16:50 UTC
[Xen-devel] Re: [PATCH] Fix name of Xen event-channel device
Bastian Blank wrote:> The Xen event-channel device is named evtchn in the kernel but always > used as /dev/xen/evtchn in userspace. This patch fixes the name. > > Signed-off-by: Bastian Blank <waldi@debian.org> > > diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c > index 66e185c..89cd743 100644 > --- a/drivers/xen/evtchn.c > +++ b/drivers/xen/evtchn.c > @@ -471,7 +471,7 @@ static const struct file_operations evtchn_fops = { > > static struct miscdevice evtchn_miscdev = { > .minor = MISC_DYNAMIC_MINOR, > - .name = "evtchn", > + .name = "xen/evtchn",Um. Will existing userspace - esp. udev rules - continue to work after this change? Also, how about other xen-related devices which are moved to /dev/xen in that same udev rules? Thanks! /mjt _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bastian Blank
2010-May-27 17:13 UTC
[Xen-devel] Re: [PATCH] Fix name of Xen event-channel device
On Thu, May 27, 2010 at 08:50:39PM +0400, Michael Tokarev wrote:> Bastian Blank wrote: > > The Xen event-channel device is named evtchn in the kernel but always > > used as /dev/xen/evtchn in userspace. This patch fixes the name. > > > > Signed-off-by: Bastian Blank <waldi@debian.org> > > > > diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c > > index 66e185c..89cd743 100644 > > --- a/drivers/xen/evtchn.c > > +++ b/drivers/xen/evtchn.c > > @@ -471,7 +471,7 @@ static const struct file_operations evtchn_fops = { > > > > static struct miscdevice evtchn_miscdev = { > > .minor = MISC_DYNAMIC_MINOR, > > - .name = "evtchn", > > + .name = "xen/evtchn", > > Um. Will existing userspace - esp. udev rules - continue > to work after this change?The udev rules will just not longer match, as they only rename the device, this is no problem. However libxc _will_ break, as it lacks proper error check in its own device creation routine. However there are not much possibilities here: this support will go away and it will annoy every user for some time.> Also, how about other xen-related > devices which are moved to /dev/xen in that same udev rules?This is the only device currently supported by the vanilla kernel, everything else is in the Xen tree only. Bastian -- Totally illogical, there was no chance. -- Spock, "The Galileo Seven", stardate 2822.3 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2010-May-27 22:05 UTC
Re: [Xen-devel] Name of event-channel and other devices vs. udev
On 05/27/2010 07:31 AM, Bastian Blank wrote:> On Thu, May 27, 2010 at 09:35:12AM +0200, Bastian Blank wrote: > >> On Wed, May 26, 2010 at 12:51:44PM +0200, Bastian Blank wrote: >> >>> - Make the kernel name the device "xen/evtchn". >>> >> This approach somewhat reliable failed for me[1]. Also nothing else in >> the kernel uses it. So I assume this is not really supported. >> > Xen themself is responsible for this behaviour. >You presumably don''t mean the hypervisor. Do you mean the toolstack is doing something bad when the misc device has a ''/'' in it? I noticed when I applied your change it does things like look in /sys/class/xen/evtchn (or something). What other changes are needed to keep things working after this change? J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bastian Blank
2010-May-27 22:26 UTC
Re: [Xen-devel] Name of event-channel and other devices vs. udev
On Thu, May 27, 2010 at 03:05:10PM -0700, Jeremy Fitzhardinge wrote:> On 05/27/2010 07:31 AM, Bastian Blank wrote: > > Xen themself is responsible for this behaviour. > You presumably don''t mean the hypervisor.No. But Xen as delivered == hypervisor + tools.> Do you mean the toolstack is > doing something bad when the misc device has a ''/'' in it? I noticed > when I applied your change it does things like look in > /sys/class/xen/evtchn (or something).It does the following: - Search in /sys/**/evtchn for the device number, this fails. - Compares the existing /dev/xen/evtchn with the error and unlinks it. - Tries to mknod it again with the error value, this fails.> What other changes are needed to keep things working after this change?To possibilities: - Fix the error detection in this crude device creation code. - Rip it out and always rely on the system to provide the devices. For Debian I already decided to use the later one. Bastian -- We''ll pivot at warp 2 and bring all tubes to bear, Mr. Sulu! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2010-May-27 22:37 UTC
Re: [Xen-devel] Name of event-channel and other devices vs. udev
On 05/27/2010 03:26 PM, Bastian Blank wrote:> It does the following: > - Search in /sys/**/evtchn for the device number, this fails. > - Compares the existing /dev/xen/evtchn with the error and unlinks it. > - Tries to mknod it again with the error value, this fails. >That''s unfortunate.>> What other changes are needed to keep things working after this change? >> > To possibilities: > - Fix the error detection in this crude device creation code. > - Rip it out and always rely on the system to provide the devices. > > For Debian I already decided to use the later one. >Yes, that seems like the cleanest approach. Does it need any udev config to get that right? In particular, is there a mechanism to autoload misc device modules? J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bastian Blank
2010-May-27 22:58 UTC
Re: [Xen-devel] Name of event-channel and other devices vs. udev
On Thu, May 27, 2010 at 03:37:49PM -0700, Jeremy Fitzhardinge wrote:> On 05/27/2010 03:26 PM, Bastian Blank wrote: > > To possibilities: > > - Fix the error detection in this crude device creation code. > > - Rip it out and always rely on the system to provide the devices. > > For Debian I already decided to use the later one. > Yes, that seems like the cleanest approach. Does it need any udev > config to get that right? In particular, is there a mechanism to > autoload misc device modules?No, there is no autoloading possible; neither now nor with the patch. The default udev config is correct in this case. Bastian -- Warp 7 -- It''s a law we can live with. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kay Sievers
2010-May-28 13:24 UTC
[Xen-devel] Re: [PATCH] Fix name of Xen event-channel device
On Thu, May 27, 2010 at 19:13, Bastian Blank <waldi@debian.org> wrote:> On Thu, May 27, 2010 at 08:50:39PM +0400, Michael Tokarev wrote: >> Bastian Blank wrote: >> > The Xen event-channel device is named evtchn in the kernel but always >> > used as /dev/xen/evtchn in userspace. This patch fixes the name. >> > >> > Signed-off-by: Bastian Blank <waldi@debian.org> >> > >> > diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c >> > index 66e185c..89cd743 100644 >> > --- a/drivers/xen/evtchn.c >> > +++ b/drivers/xen/evtchn.c >> > @@ -471,7 +471,7 @@ static const struct file_operations evtchn_fops = { >> > >> > static struct miscdevice evtchn_miscdev = { >> > .minor = MISC_DYNAMIC_MINOR, >> > - .name = "evtchn", >> > + .name = "xen/evtchn", >> >> Um. Will existing userspace - esp. udev rules - continue >> to work after this change? > > The udev rules will just not longer match, as they only rename the > device, this is no problem. However libxc _will_ break, as it lacks > proper error check in its own device creation routine. > > However there are not much possibilities here: this support will go away > and it will annoy every user for some time. > >> Also, how about other xen-related >> devices which are moved to /dev/xen in that same udev rules? > > This is the only device currently supported by the vanilla kernel, > everything else is in the Xen tree only.And naming of primary device nodes is no longer udev''s task. All these rules are removed from the default udev rules. These names must all come from the kernel these days. Udev will log errors if udev rules specify names which are not in sync with the kernel, so they can be fixed in the kernel or in the rules. With devtmpfs the kernel needs to know all the names to create them on its own. Udev only manages permissions, possibly creates additional symlinks, runs programs, and distribute the events to userspace. Udev no longer manages the naming of any primary device node. Thanks, Kay _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Michael Tokarev
2010-May-28 13:41 UTC
[Xen-devel] Re: [PATCH] Fix name of Xen event-channel device
Kay Sievers wrote:> On Thu, May 27, 2010 at 19:13, Bastian Blank <waldi@debian.org> wrote:[]>>> Also, how about other xen-related >>> devices which are moved to /dev/xen in that same udev rules? >> This is the only device currently supported by the vanilla kernel, >> everything else is in the Xen tree only. > > And naming of primary device nodes is no longer udev''s task. All these > rules are removed from the default udev rules. These names must all > come from the kernel these days. Udev will log errors if udev rules > specify names which are not in sync with the kernel, so they can be > fixed in the kernel or in the rules.Finally!... It''s been hashed and rehashed back when udevd were invented to replace devfs and we returned back to traditional kernel-generated names for a base. Oh well... That''s, actually, _excellent_ news, something that bothered me for all these years since 2.4 kernel - that I don''t have some devices in /dev (because they''re named differently or moved to a subdir) which are mentioned in dmesg or sysfs. Hooray! Will check for all sound (/dev/snd/), input (/dev/input/), usb (/dev/usb/) and oh, the famous tun (/dev/net/tun) devices - you intrigued me!.. ;) Thanks! /mjt _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2010-May-28 23:20 UTC
[Xen-devel] Re: [PATCH] Fix name of Xen event-channel device
On 05/27/2010 10:13 AM, Bastian Blank wrote:> The udev rules will just not longer match, as they only rename the > device, this is no problem. However libxc _will_ break, as it lacks > proper error check in its own device creation routine. >Yeah, that''s really annoying. I can''t change the kernel without also having a flag day to update libxc. I guess we could make sure all the stable Xen branches get a libxc fix backported to them, but I wonder if it would break other toolstacks?> However there are not much possibilities here: this support will go away > and it will annoy every user for some time. >But if we don''t make any kernel changes then libxc will muddle on even if udev stops handling the device name properly? J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel