xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 3 of 4] libxl: Introduce pci_assignable_add and pci_assignable_remove
Date: Thu, 10 May 2012 17:29:07 +0100	[thread overview]
Message-ID: <4FABECD3.7000401@eu.citrix.com> (raw)
In-Reply-To: <1336662282.14220.9.camel@zakaz.uk.xensource.com>

On 10/05/12 16:04, Ian Campbell wrote:
>>>> +    spath = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/driver",
>>>> +                           pcidev->domain,
>>>> +                           pcidev->bus,
>>>> +                           pcidev->dev,
>>>> +                           pcidev->func);
>>>> +    if ( !lstat(spath,&st) ) {
>>>> +        /* Find the canonical path to the driver. */
>>>> +        *dp = libxl__zalloc(gc, PATH_MAX);
>>> Should we be actually using fpathconf / sysconf here?
>> I don't really follow.  What exactly is it you're proposing?
> PATH_MAX isn't really a constant these days, you can get the dynamic
> value for a particular filesystem from fpathconf. I honestly don't know
> how much of a concern this really is, especially given we are always
> necessarily talking to sysfs.
Ah right -- I didn't get that you were referring to PATH_MAX.  The 
"realpath" manpage specifies:   "The resulting path‐name is stored as a 
null-terminated string, up to a maximum of PATH_MAX bytes, in the buffer 
pointed to by resolved_path."  That's why I used PATH_MAX in the 
allocation.  I would hope that if the manpage says PATH_MAX, it means 
PATH_MAX, and not "some other thing which you can get by running this 
complicated command I haven't mentioned". :-)

OK -- I've also added a comment explaining why I'm doing what I'm doing 
with slots, which I'll include when I re-post the patch.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2012-05-10 16:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 10:28 [PATCH 0 of 4] Add commands to automatically prep devices for pass-through George Dunlap
2012-05-09 10:28 ` [PATCH 1 of 4] libxl: Make a helper function write a BDF to a sysfs path George Dunlap
2012-05-10 10:40   ` Ian Campbell
2012-05-09 10:28 ` [PATCH 2 of 4] libxl: Rename pci_list_assignable to pci_assignable_list George Dunlap
2012-05-10 10:43   ` Ian Campbell
2012-05-10 10:54     ` George Dunlap
2012-05-09 10:28 ` [PATCH 3 of 4] libxl: Introduce pci_assignable_add and pci_assignable_remove George Dunlap
2012-05-10 11:19   ` Ian Campbell
2012-05-10 14:55     ` George Dunlap
2012-05-10 15:04       ` Ian Campbell
2012-05-10 16:29         ` George Dunlap [this message]
2012-05-10 16:45           ` Ian Campbell
2012-05-09 10:28 ` [PATCH 4 of 4] xl: Add pci_assignable_add and remove commands George Dunlap
2012-05-10 11:31   ` Ian Campbell
2012-05-11 11:13     ` George Dunlap
2012-05-11 11:19       ` Ian Campbell
2012-05-11 12:50         ` George Dunlap
2012-05-11 12:58           ` Ian Campbell
2012-05-09 10:49 ` [PATCH 0 of 4] Add commands to automatically prep devices for pass-through Ian Campbell
2012-05-09 11:03   ` George Dunlap
2012-05-09 11:59     ` Ian Campbell
2012-05-09 13:45       ` George Dunlap
2012-05-10 10:17         ` George Dunlap
2012-05-10 10:38           ` Ian Campbell
2012-05-10 14:12             ` Sander Eikelenboom
2012-05-10 14:16               ` Ian Campbell
2012-05-10 16:15                 ` Konrad Rzeszutek Wilk
2012-05-09 10:56 ` David Vrabel
2012-05-09 11:11   ` George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FABECD3.7000401@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).