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] [PATCH] Add device-path command.

To: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Add device-path command.
From: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Date: Tue, 07 Apr 2009 17:16:20 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Tue, 07 Apr 2009 01:16:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090407160730.9D93.27C06F64@xxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20090406140600.GA18640@xxxxxxxxxx> <20090407160730.9D93.27C06F64@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 07 Apr 2009 16:29:05 +0900
Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx> wrote:

> On Mon, 6 Apr 2009 15:06:00 +0100
> "Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote:
> 
> > On Mon, Apr 06, 2009 at 05:03:37PM +0900, Yuji Shimada wrote:
> > > This patch adds device-path command that converts SBDF into device
> > > path.
> > 
> > [snip]
> > 
> > > diff -r 5a60eb7fad79 tools/misc/device-path
> > > --- /dev/null     Thu Jan 01 00:00:00 1970 +0000
> > > +++ b/tools/misc/device-path      Mon Apr 06 16:30:11 2009 +0900
> > 
> > 
> > [snip]
> > 
> > > +SYSFS_ACPI_DEVS_PATH = '/firmware/acpi/namespace/ACPI/_SB'
> > > +
> > > +def find_hid_uid(dom, b, d, f):
> > > +    sb_path = find_sysfs_mnt() + SYSFS_ACPI_DEVS_PATH
> > > +    obj_list = os.listdir(sb_path)
> > > +    for obj in obj_list:
> > > +        obj_path = sb_path + '/' + obj.strip() + '/'
> > > +        if os.path.exists(obj_path + 'seg') and \
> > > +            os.path.exists(obj_path + 'bbn'):
> > > +            seg = open(obj_path + 'seg').read()
> > > +            bbn = open(obj_path + 'bbn').read()
> > > +            if int(seg) == dom and int(bbn) == b:
> > > +                hid = open(obj_path + 'hid').read()
> > > +                if os.path.exists(obj_path + 'uid') is False:
> > > +                    path_str = hid.strip()
> > > +                else:
> > > +                    uid = open(obj_path + 'uid').read()
> > > +                    path_str = hid.strip() + ':' + uid.strip()
> > > +                return path_str
> > > +    return None
> > 
> > I don't know how critical this piece of code is to the overall functionality
> > in this tool, but be warned that the path being used here was removed from
> > sysfs in upstream kernel quite a while ago
> > 
> > To quote an old copy of  Documentation/feature-removal-schedule.txt
> > 
> >   What:  /sys/firmware/acpi/namespace
> >   When:  2.6.21
> >   Why:   The ACPI namespace is effectively the symbol list for
> >          the BIOS.  The device names are completely arbitrary
> >          and have no place being exposed to user-space.
> >   
> >          For those interested in the BIOS ACPI namespace,
> >          the BIOS can be extracted and disassembled with acpidump
> >          and iasl as documented in the pmtools package here:
> >          http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/utils
> > 
> 
> It is difficult for users to get device path of particular device.
> So I made this command that converts SBDF into device path.
> 
> SBDF of devices can be changed at boot time. But device path is not
> changed at boot time.
> I have already added the function to specify guest passthrough device
> by device path with "guestdev" boot parameter.
> The linux-2.6.18-xen kernel changeset is the following.
> 
> # changeset fad85221407bf32df2574bca54cba730748343a2
> # changeset 2fdc121e9b5d76464b3efd47d711c58253ef6348
> # changeset cfb171ddbb333df9671a1da62e40122a56213ab4
> # changeset 79e82ae1bad02c0dfb504db3153599e52a0affb3

Sorry, above changesets are wrong.
They are correct changesets.

# changeset 765 : fad85221407bf32df2574bca54cba730748343a2
# changeset 766 : 2fdc121e9b5d76464b3efd47d711c58253ef6348
# changeset 767 : 78d81e85e8cd8a0a26bc9b760c67d435341f43f8
# changeset 768 : cfb171ddbb333df9671a1da62e40122a56213ab4

Thanks,
--
Yuji Shimada


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