[libvirt] [PATCH 1/8] util: new function virPCIDeviceGetVFIOGroupDev

Eric Blake eblake at redhat.com
Thu Apr 25 20:06:00 UTC 2013


On 04/25/2013 11:57 AM, Laine Stump wrote:
> Given a virPCIDevice, this function returns the path for the device
> that controls the vfio group the device belongs to,
> e.g. "/dev/vfio/15".
> ---

> +    if (virAsprintf(&groupDev, "/dev/vfio/%s", basename(groupPath)) < 0) {

We shouldn't be using basename() from <libgen.h> - it has horrible
portability problems, and is not thread-safe.  Instead, use
last_component() from gnulib's "dirname.h".  [I really ought to add a
syntax-check to cfg.mk and clean up the existing offenders].

ACK with that fixed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130425/e5c3fae0/attachment-0001.sig>


More information about the libvir-list mailing list