[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] Add device-path command.
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |