Re: [PATCH 1/8 v8] util: Prepare helpers for unpriv_sgio setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/14/2012 08:41 AM, Osier Yang wrote:
> "virGetDeviceID" could be used across the sources, but it doesn't
> relate with this series, and could be done later.
> 
> * src/util/util.h: (Declare virGetDeviceID, and
>                     vir{Get,Set}DeviceUnprivSGIO)
> * src/util/util.c: (Implement virGetDeviceID and
>                     vir{Get,Set}DeviceUnprivSGIO)
> * src/libvirt_private.syms: Export private symbols of upper helpers
> ---
>  src/libvirt_private.syms |    3 +
>  src/util/util.c          |  140 ++++++++++++++++++++++++++++++++++++++++++++++
>  src/util/util.h          |   11 ++++
>  3 files changed, 154 insertions(+), 0 deletions(-)

Wait until post-release, but for this version, I'm comfortable giving:

ACK.

> +#if defined(major) && defined(minor)
> +int
> +virGetDeviceID(const char *path, int *major, int *minor)

The compiler didn't warn about your use of a local variable named
'major' conflicting with a macro-like function 'major()'?  It might be
worth using 'maj' and 'min' for the local variables, if only to avoid
potential confusion.  But since things compiled warning-free, that's
cosmetic.


> +#define SYSFS_DEV_BLOCK_PATH "/sys/dev/block"
> +
> +static char *
> +virGetUnprivSGIOSysfsPath(const char *path,
> +                          const char *sysfs_dir)
> +{
> +    int major, minor;

Same idea on local naming.

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]