WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Help/problems with blktap on xen-unstable

To: "Steven Rostedt" <srostedt@xxxxxxxxxx>
Subject: Re: [Xen-devel] Help/problems with blktap on xen-unstable
From: "Andrew Warfield" <andrew.warfield@xxxxxxxxxxxx>
Date: Thu, 21 Sep 2006 11:57:08 -0700
Cc: Roland Paterson-Jones <roland@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 21 Sep 2006 11:57:34 -0700
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=dGJbAG44F6pljGanvmdRoX/aAsu7wH5MYljUmR45hCoKJXrVC/N0pmKCRgleWNC2Qiqcws1JKF875Vp+HXkqo2MXZWgFt8OEZh8fprmKZBTBGHgK8Vr2HLKRl5yukLzvOJK4ASJOesfAuQ5GSpjTerTgr80hMRdnXZI/FyyZZFY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45127E5A.1090202@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4510E1C0.7020405@xxxxxxxxxxxx> <1158747512.32181.7.camel@xxxxxxxxxxxxxxxxxxxx> <45118A05.2030909@xxxxxxxxxx> <45123C4B.1020205@xxxxxxxxxxxx> <45127E5A.1090202@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The current device allocation code is pretty crap, and I completely
agree that the fixed assignments suck.  I think my inclination would
be towards everything being dynamically assigned, and that the tapdisk
devices be allocated on demand.  This would clean up a bunch of the
kernel code -- get rid of the fixed array of tap structs/device nodes
and let us scale up to larger numbers of active devices in the future.

If you're offering to cook a patch, we'd be delighted to see it.  I
could also be argued into an interim solution to fix the current
conflict problems in advance of a more substantial effort. ;)

Thanks for the comments Steve, sorry for the slowish reply.

a.

On 9/21/06, Steven Rostedt <srostedt@xxxxxxxxxx> wrote:
Roland Paterson-Jones wrote:
> Steven Rostedt wrote:

>> Any thought about making blktap a miscellaneous device and have
>> blkctrl just read /proc/misc to find the node?  I could easily write
>> up a patch, if others think this is appropriate.
>
> I don't understand the technical details, but this sounds like it would
> avoid both hardcoded or configured major number, so if that's the case
> I'd be very keen for the patch.
>

There's a few issues.

As a miscellaneous device, it no longer has a major number.  All
versions would become a miscellaneous device. So instead of having a
blktap major, and the minor pointing to each of the blktap descriptors
in the array, you would record the minor in the descriptor, and among
opening the device, you need to search the descriptors to find the minor
that matches the opened device.

So you might get something like:

# cat /proc/misc
35 blktap0
39 blktap1
40 blktap2
84 blktap3

Where the index no longer matches the inode minor increment.  It
probably wont be this bad, and usually would increment, but you don't
know if another device has jumped in.

But the search is only on opening the device and not an the operations,
because once you find the descriptor in blktap_open you save that in the
private date field of the file descriptor.


Another solution is to just make it a dynamic major, and then put the
result somewhere that a tool can find it.  Most acceptable now, I guess,
is in /sys.  Even though I find working in the /proc is easier.

Or, have a blktapctl as a miscellaneous device, and this can tell you
where the major number was. Finding the blktapctl would be easy, since
it would be in /proc/misc.

So there's several solutions to this.  It's just a matter of which is
most acceptable.

-- Steve


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel