LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: minor device number request for /dev/kvm (kernel-based virtual machine)
[not found] ` <93C4769E3BED6B42B7203BD6F065654C08C5D6D3@dmoexc01.emea.cpqcorp.net>
@ 2007-03-01 11:58 ` Avi Kivity
2007-03-01 13:03 ` Jan Engelhardt
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2007-03-01 11:58 UTC (permalink / raw)
To: Mathiasen, Torben; +Cc: linux-kernel, kvm-devel
Mathiasen, Torben wrote:
>> 10 char Non-serial mice, misc features
>> nnn = /dev/kvm kernel-based virtual machine (hardware
>> virtualization extensions)
>>
>>
>
> Major 10, minor 256 has been assigned to /dev/kvm. Let me know if this is nok okay.
>
>
It doesn't work. The culprit appears to be
drivers/char/misc.c:
register_chrdev(MISC_MAJOR,"misc",&misc_fops)
which in turn means:
fs/char_dev.c:
> int register_chrdev(unsigned int major, const char *name,
> const struct file_operations *fops)
> {
> struct char_device_struct *cd;
> struct cdev *cdev;
> char *s;
> int err = -ENOMEM;
>
> cd = __register_chrdev_region(major, 0, 256, name);
So misc minor numbers under 256 are not supported.
What's the way out? Increase the region size? I don't know if that's safe.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: minor device number request for /dev/kvm (kernel-based virtual machine)
2007-03-01 11:58 ` minor device number request for /dev/kvm (kernel-based virtual machine) Avi Kivity
@ 2007-03-01 13:03 ` Jan Engelhardt
2007-03-01 13:05 ` Avi Kivity
0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2007-03-01 13:03 UTC (permalink / raw)
To: Avi Kivity; +Cc: Mathiasen, Torben, linux-kernel, kvm-devel
On Mar 1 2007 13:58, Avi Kivity wrote:
>
> fs/char_dev.c:
>> int register_chrdev(unsigned int major, const char *name,
>> const struct file_operations *fops)
>> {
>> struct char_device_struct *cd;
>> struct cdev *cdev;
>> char *s;
>> int err = -ENOMEM;
>>
>> cd = __register_chrdev_region(major, 0, 256, name);
>
> So misc minor numbers under 256 are not supported.
>
> What's the way out? Increase the region size? I don't know if that's safe.
If it does not increase memory usage, then possibly:
__register_chrdev_region(major, 0, (~0U) & MINORMASK, name);
or (1<<MINORMASK)-1 if that's more clear
Jan
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: minor device number request for /dev/kvm (kernel-based virtual machine)
2007-03-01 13:03 ` Jan Engelhardt
@ 2007-03-01 13:05 ` Avi Kivity
2007-03-01 14:09 ` Mathiasen, Torben
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2007-03-01 13:05 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Mathiasen, Torben, linux-kernel, kvm-devel
Jan Engelhardt wrote:
> On Mar 1 2007 13:58, Avi Kivity wrote:
>
>> fs/char_dev.c:
>>
>>> int register_chrdev(unsigned int major, const char *name,
>>> const struct file_operations *fops)
>>> {
>>> struct char_device_struct *cd;
>>> struct cdev *cdev;
>>> char *s;
>>> int err = -ENOMEM;
>>>
>>> cd = __register_chrdev_region(major, 0, 256, name);
>>>
>> So misc minor numbers under 256 are not supported.
>>
>> What's the way out? Increase the region size? I don't know if that's safe.
>>
>
> If it does not increase memory usage, then possibly:
>
> __register_chrdev_region(major, 0, (~0U) & MINORMASK, name);
> or (1<<MINORMASK)-1 if that's more clear
>
>
I'm more worried about something in the chardev bowels not supporting
>8bit minors well.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: minor device number request for /dev/kvm (kernel-based virtual machine)
2007-03-01 13:05 ` Avi Kivity
@ 2007-03-01 14:09 ` Mathiasen, Torben
0 siblings, 0 replies; 4+ messages in thread
From: Mathiasen, Torben @ 2007-03-01 14:09 UTC (permalink / raw)
To: Avi Kivity, Jan Engelhardt; +Cc: linux-kernel, kvm-devel
> > If it does not increase memory usage, then possibly:
> >
> > __register_chrdev_region(major, 0, (~0U) & MINORMASK, name);
> > or (1<<MINORMASK)-1 if that's more
> clear
> >
> >
>
> I'm more worried about something in the chardev bowels not supporting
> >8bit minors well.
>
I was under the impression that large minors was supported for misc.
Skimming the code that does not seem to be the case. Can someone
comment?
Torben
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-01 14:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <45975F61.4070506@qumranet.com>
[not found] ` <93C4769E3BED6B42B7203BD6F065654C08C5D6D3@dmoexc01.emea.cpqcorp.net>
2007-03-01 11:58 ` minor device number request for /dev/kvm (kernel-based virtual machine) Avi Kivity
2007-03-01 13:03 ` Jan Engelhardt
2007-03-01 13:05 ` Avi Kivity
2007-03-01 14:09 ` Mathiasen, Torben
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).