[libvirt] [PATCH 1/8 v8] util: Prepare helpers for unpriv_sgio setting
Eric Blake
eblake at redhat.com
Fri Dec 14 18:56:31 UTC 2012
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121214/d94a057d/attachment-0001.sig>
More information about the libvir-list
mailing list