[libvirt] [PATCH 1/8 v8] util: Prepare helpers for unpriv_sgio setting
Osier Yang
jyang at redhat.com
Sun Dec 16 18:30:39 UTC 2012
On 2012年12月15日 02:56, Eric Blake wrote:
> 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.
Reasonable, I will udpate it when pushing.
>
>
>> +#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.
>
More information about the libvir-list
mailing list