[ovirt-users] Re: [OT] Major and minor numbers assigned to /dev/vdx virtio devices

2020-07-14 Thread Paolo Bonzini
I think they are assigned at boot time but I would have to check the
sources and I am on vacation. :-)

Paolo

Il lun 13 lug 2020, 16:37 Sandro Bonazzola  ha scritto:

> +Paolo Bonzini  can you help here?
>
> Il giorno mer 1 lug 2020 alle ore 16:56 Gianluca Cecchi <
> gianluca.cec...@gmail.com> ha scritto:
>
>> Hello,
>> isn't there an official major/minor numbering scheme for virtio disks?
>> Sometimes I see 251 major or 252 or so... what is the udev assignment
>> logic?
>> Reading here:
>> https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
>>
>>  240-254 block   LOCAL/EXPERIMENTAL USE
>>  Allocated for local/experimental use.  For devices not
>>  assigned official numbers, these ranges should be
>>  used in order to avoid conflicting with future assignments.
>>
>> it seems they are in the range of experimental ones, while for example
>> Xen /dev/xvdx devices have their own static assignment (202 major)
>>
>> Thanks,
>> Gianluca
>> ___
>> Users mailing list -- users@ovirt.org
>> To unsubscribe send an email to users-le...@ovirt.org
>> Privacy Statement: https://www.ovirt.org/privacy-policy.html
>> oVirt Code of Conduct:
>> https://www.ovirt.org/community/about/community-guidelines/
>> List Archives:
>> https://lists.ovirt.org/archives/list/users@ovirt.org/message/AEQB6H75QLYP6ENIEYROI2VY4BJS3SKL/
>>
>
>
> --
>
> Sandro Bonazzola
>
> MANAGER, SOFTWARE ENGINEERING, EMEA R RHV
>
> Red Hat EMEA 
>
> sbona...@redhat.com
> 
>
> *Red Hat respects your work life balance. Therefore there is no need to
> answer this email out of your office hours.
> *
>
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/YQZP2TFHCMWRFZLLHFTWW3HFQCRBJHF7/


[ovirt-users] Re: [OT] Major and minor numbers assigned to /dev/vdx virtio devices

2020-07-14 Thread Gianluca Cecchi
On Tue, Jul 14, 2020 at 4:40 PM Stefan Hajnoczi  wrote:

> On Mon, Jul 13, 2020 at 09:53:31PM +0300, Nir Soffer wrote:
> > On Wed, Jul 1, 2020 at 5:55 PM Gianluca Cecchi
> >  wrote:
> > >
> > > Hello,
> > > isn't there an official major/minor numbering scheme for virtio disks?
> > > Sometimes I see 251 major or 252 or so... what is the udev assignment
> logic?
> > > Reading here:
> > > https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
> > >
> > >  240-254 block LOCAL/EXPERIMENTAL USE
> > > Allocated for local/experimental use.  For devices not
> > > assigned official numbers, these ranges should be
> > > used in order to avoid conflicting with future assignments.
> > >
> > > it seems they are in the range of experimental ones, while for example
> Xen /dev/xvdx devices have their own static assignment (202 major)
>
> No, the Linux virtio_blk driver does not use a static device major number.
>
> Regarding udev, on my Fedora system
> /usr/lib/udev/rules.d/60-persistent-storage.rules has rules like this:
>
> KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}",
> SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"
>
> The rules match on the "vd*" name. If you are writing udev rules you
> could use the same approach.
>
> Is there a specific problem faced when there is no static device major
> number?
>
> Stefan
>

Thanks for the information.
No, it was only a curiosity: during a recovery action (actually it was a
"poor man" P2V operation using dd) where I had to rebuild initrd file and
to reinstall grub in a chroot environment,
I had to run mknod commands to manually create the /dev/vdax files and
comparing two different existing guests I stumbled upon their /dev/vda
files that had different major/minor numbers, so I was not sure what to
use

Gianluca
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/EVKQXRMIBA3VILS4RK4OBLZAS3F3AUDB/


[ovirt-users] Re: [OT] Major and minor numbers assigned to /dev/vdx virtio devices

2020-07-14 Thread Stefan Hajnoczi
On Mon, Jul 13, 2020 at 09:53:31PM +0300, Nir Soffer wrote:
> On Wed, Jul 1, 2020 at 5:55 PM Gianluca Cecchi
>  wrote:
> >
> > Hello,
> > isn't there an official major/minor numbering scheme for virtio disks?
> > Sometimes I see 251 major or 252 or so... what is the udev assignment logic?
> > Reading here:
> > https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
> >
> >  240-254 block LOCAL/EXPERIMENTAL USE
> > Allocated for local/experimental use.  For devices not
> > assigned official numbers, these ranges should be
> > used in order to avoid conflicting with future assignments.
> >
> > it seems they are in the range of experimental ones, while for example Xen 
> > /dev/xvdx devices have their own static assignment (202 major)

No, the Linux virtio_blk driver does not use a static device major number.

Regarding udev, on my Fedora system
/usr/lib/udev/rules.d/60-persistent-storage.rules has rules like this:

KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", 
SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"

The rules match on the "vd*" name. If you are writing udev rules you
could use the same approach.

Is there a specific problem faced when there is no static device major
number?

Stefan


signature.asc
Description: PGP signature
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/2CN5HTOREEXF4ILHZHIHNLJEFZM7HH5L/


[ovirt-users] Re: [OT] Major and minor numbers assigned to /dev/vdx virtio devices

2020-07-13 Thread Nir Soffer
On Wed, Jul 1, 2020 at 5:55 PM Gianluca Cecchi
 wrote:
>
> Hello,
> isn't there an official major/minor numbering scheme for virtio disks?
> Sometimes I see 251 major or 252 or so... what is the udev assignment logic?
> Reading here:
> https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
>
>  240-254 block LOCAL/EXPERIMENTAL USE
> Allocated for local/experimental use.  For devices not
> assigned official numbers, these ranges should be
> used in order to avoid conflicting with future assignments.
>
> it seems they are in the range of experimental ones, while for example Xen 
> /dev/xvdx devices have their own static assignment (202 major)

This question belongs to qemu-discuss.

Also added some people that may help.

Nir
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/CLMFTLBSHR5K6V6C5E4DEQYVOAD5JGAA/


[ovirt-users] Re: [OT] Major and minor numbers assigned to /dev/vdx virtio devices

2020-07-13 Thread Sandro Bonazzola
+Paolo Bonzini  can you help here?

Il giorno mer 1 lug 2020 alle ore 16:56 Gianluca Cecchi <
gianluca.cec...@gmail.com> ha scritto:

> Hello,
> isn't there an official major/minor numbering scheme for virtio disks?
> Sometimes I see 251 major or 252 or so... what is the udev assignment
> logic?
> Reading here:
> https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
>
>  240-254 blockLOCAL/EXPERIMENTAL USE
>   Allocated for local/experimental use.  For devices not
>   assigned official numbers, these ranges should be
>   used in order to avoid conflicting with future assignments.
>
> it seems they are in the range of experimental ones, while for example Xen
> /dev/xvdx devices have their own static assignment (202 major)
>
> Thanks,
> Gianluca
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/privacy-policy.html
> oVirt Code of Conduct:
> https://www.ovirt.org/community/about/community-guidelines/
> List Archives:
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/AEQB6H75QLYP6ENIEYROI2VY4BJS3SKL/
>


-- 

Sandro Bonazzola

MANAGER, SOFTWARE ENGINEERING, EMEA R RHV

Red Hat EMEA 

sbona...@redhat.com


*Red Hat respects your work life balance. Therefore there is no need to
answer this email out of your office hours.
*
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/AWIFHZRPTQOS4UPV2XR3PTDG7HI7KILY/