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

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

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
* src/util/util.c: (Implement virGetDeviceID and
* 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:


+#if defined(major)&&  defined(minor)
+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

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.

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