Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755448AbcCCBZd (ORCPT ); Wed, 2 Mar 2016 20:25:33 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34982 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754557AbcCCBZb (ORCPT ); Wed, 2 Mar 2016 20:25:31 -0500 Date: Wed, 2 Mar 2016 17:25:30 -0800 From: Greg Kroah-Hartman To: Jin Qian Cc: linux-kernel@vger.kernel.org, jsharkey@google.com, digit@google.com, pprabhu@google.com, Yu Ning Subject: Re: allocate an official device major number for virtio device? Message-ID: <20160303012530.GA23521@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 848 Lines: 23 On Wed, Mar 02, 2016 at 05:08:00PM -0800, Jin Qian wrote: > Hi - > > Can we allocate an official device major number for virtio devices? > Currently it's using 240-254 (LOCAL/EXPERIMENTAL USE). The reason we > ask for this is because userspace will need to treat virtio block > devices differently and need a way to detect such device. For example, > it checks major number to detect scsi and mmc device. > > https://android-review.googlesource.com/#/c/195240 > > With dynamic major numbers 240-254, we might treat other devices as > virtio block device incorrectly. You shouldn't treat them incorrectly, devtmpfs handles this for you automatically, so I'd recommend using the dynamic majors please. And what in-kernel code is using the "experimental" range today? Do you have a pointer to that? We should fix that now... thanks, greg k-h