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.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list