From a904a56c3622994a30a41ea512e33de648ede3d6 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Tue, 2 Dec 2008 12:41:29 +0000 Subject: [PATCH] Older distributions (i.e. RHEL-5) don't have udevadm at all, but they do have udevsettle. So change our tests to prefer udevadm if it exists, but to fall back to udevsettle if it does not. Signed-off-by: Chris Lalancette --- ChangeLog | 6 ++++++ configure.in | 6 ++++++ src/storage_backend.c | 8 ++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b08206922..9d9c162e87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Dec 2 13:45:00 CET 2008 Chris Lalancette + * configure.in, src/storage_backend.c: Older distributions (i.e. + RHEL-5) don't have udevadm at all, but they do have udevsettle. So + change our tests to prefer udevadm if it exists, but to fall back to + udevsettle if it does not. + Tue Dec 2 11:34:22 GMT 2008 Daniel P. Berrange * qemud/qemud.c: Registering network, storage & nodedev drivers diff --git a/configure.in b/configure.in index 5359433a1f..0036145317 100644 --- a/configure.in +++ b/configure.in @@ -117,6 +117,8 @@ AC_PATH_PROG([BRCTL], [brctl], [brctl], [/sbin:/usr/sbin:/usr/local/sbin:$PATH]) AC_PATH_PROG([UDEVADM], [udevadm], [], [/sbin:/usr/sbin:/usr/local/sbin:$PATH]) +AC_PATH_PROG([UDEVSETTLE], [udevsettle], [], + [/sbin:/usr/sbin:/usr/local/sbin:$PATH]) AC_DEFINE_UNQUOTED([DNSMASQ],["$DNSMASQ"], [Location or name of the dnsmasq program]) @@ -126,6 +128,10 @@ if test -n "$UDEVADM"; then AC_DEFINE_UNQUOTED([UDEVADM],["$UDEVADM"], [Location or name of the udevadm program]) fi +if test -n "$UDEVSETTLE"; then + AC_DEFINE_UNQUOTED([UDEVSETTLE],["$UDEVSETTLE"], + [Location or name of the udevsettle program]) +fi dnl Specific dir for HTML output ? AC_ARG_WITH([html-dir], [AC_HELP_STRING([--with-html-dir=path], diff --git a/src/storage_backend.c b/src/storage_backend.c index 6b4fa818cb..bb247271c1 100644 --- a/src/storage_backend.c +++ b/src/storage_backend.c @@ -270,13 +270,17 @@ virStorageBackendUpdateVolInfoFD(virConnectPtr conn, return 0; } -#ifdef UDEVADM +#if defined(UDEVADM) || defined(UDEVSETTLE) void virStorageBackendWaitForDevices(virConnectPtr conn) { +#ifdef UDEVADM const char *const settleprog[] = { UDEVADM, "settle", NULL }; +#else + const char *const settleprog[] = { UDEVSETTLE, NULL }; +#endif int exitstatus; - if (access(UDEVADM, X_OK) != 0) + if (access(settleprog[0], X_OK) != 0) return; /*