On Sat, Jul 21, 2012 at 03:27:13PM +0800, Wanlong Gao wrote:
Add a macro DUP_RESOLVE_DEVICE_OR_PATH to resolve path or device.
Signed-off-by: Wanlong Gao <gaowanlong(a)cn.fujitsu.com>
---
daemon/daemon.h | 18 ++++++++++++++++++
daemon/mount.c | 13 ++-----------
po/POTFILES | 8 ++++++++
3 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 85eec45..39cc3f3 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -336,6 +336,24 @@ is_zero (const char *buffer, size_t size)
} \
} while (0)
+/* Helper for functions which need either a root(/sysroot) path,
+ * OR a /dev/ device which exists.
+ */
+#define DUP_RESOLVE_DEVICE_OR_PATH(path,buf,cancel_stmt,fail_stmt) \
Can we call this macro:
STRDUP_RESOLVE_DEVICE_OR_PATH
I think that would be more descriptive. Also this comment would
be better:
/* Same as REQUIRE_ROOT_OR_RESOLVE_DEVICE but this strdup's the result. */
Otherwise the patch seems OK.
You can delete the following files from your local repository, and
that will stop them from polluting these patches ...
+daemon/errnostring_gperf.c
+fish/cmds_gperf.c
+gobject/src/optargs-add_drive_opts.c
+gobject/src/optargs-mkfs_opts.c
+gobject/src/optargs-ntfsresize_opts.c
+gobject/src/optargs-test0.c
+ocaml/guestfs_c_actions.c
+src/errnostring_gperf.c
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming blog:
http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora