Index: configure.in =================================================================== RCS file: /data/cvs/libvirt/configure.in,v retrieving revision 1.188 diff -u -r1.188 configure.in --- configure.in 28 Nov 2008 07:50:20 -0000 1.188 +++ configure.in 28 Nov 2008 14:50:11 -0000 @@ -117,6 +117,8 @@ [/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 @@ 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], Index: src/storage_backend.c =================================================================== RCS file: /data/cvs/libvirt/src/storage_backend.c,v retrieving revision 1.31 diff -u -r1.31 storage_backend.c --- src/storage_backend.c 28 Nov 2008 07:50:20 -0000 1.31 +++ src/storage_backend.c 28 Nov 2008 14:50:11 -0000 @@ -287,6 +287,23 @@ */ virRun(conn, settleprog, &exitstatus); } +#elif defined(UDEVSETTLE) +void virStorageBackendWaitForDevices(virConnectPtr conn) +{ + const char *const settleprog[] = { UDEVSETTLE, NULL }; + int exitstatus; + + if (access(UDEVSETTLE, X_OK) != 0) + return; + + /* + * NOTE: we ignore errors here; this is just to make sure that any device + * nodes that are being created finish before we try to scan them. + * If this fails for any reason, we still have the backup of polling for + * 5 seconds for device nodes. + */ + virRun(conn, settleprog, &exitstatus); +} #else void virStorageBackendWaitForDevices(virConnectPtr conn ATTRIBUTE_UNUSED) {} #endif