]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
fix a module dependency problem
authorDaniel Veillard <veillard@redhat.com>
Wed, 17 Jun 2009 08:38:17 +0000 (08:38 +0000)
committerDaniel Veillard <veillard@redhat.com>
Wed, 17 Jun 2009 08:38:17 +0000 (08:38 +0000)
* src/node_device.[ch] src/storage_backend.[ch]: fixes a
  module dependency problem, patch by Dave Allan
Daniel

ChangeLog
src/node_device.c
src/node_device.h
src/storage_backend.c
src/storage_backend.h

index 957cbfef5d40d741870b1e26468debc03bcb14a2..829fe103c29ef264de60ab65ba603b3613af6a5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jun 17 10:31:35 CEST 2009 Daniel Veillard <veillard@redhat.com>
+
+       * src/node_device.[ch] src/storage_backend.[ch]: fixes a
+         module dependency problem, patch by Dave Allan
+
 Tue Jun 16 14:30:05 EDT 2009 Cole Robinson <crobinso@redhat.com>
 
        * src/domain_conf.c
index de51bc85f45c49ecc231d9efe2e04fc0b72bf9dc..d01695d67d32fa87688c03be05410e4bc3b544a3 100644 (file)
@@ -34,6 +34,7 @@
 #include "logging.h"
 #include "node_device_conf.h"
 #include "node_device.h"
+#include "storage_backend.h" /* For virWaitForDevices */
 
 #define VIR_FROM_THIS VIR_FROM_NODEDEV
 
@@ -560,7 +561,7 @@ find_new_device(virConnectPtr conn, const char *wwnn, const char *wwpn)
 
     while ((now - start) < LINUX_NEW_DEVICE_WAIT_TIME) {
 
-        virNodeDeviceWaitForDevices(conn);
+        virWaitForDevices(conn);
 
         dev = nodeDeviceLookupByWWN(conn, wwnn, wwpn);
 
@@ -694,32 +695,6 @@ out:
 }
 
 
-#if defined(UDEVADM) || defined(UDEVSETTLE)
-void virNodeDeviceWaitForDevices(virConnectPtr conn)
-{
-#ifdef UDEVADM
-    const char *const settleprog[] = { UDEVADM, "settle", NULL };
-#else
-    const char *const settleprog[] = { UDEVSETTLE, NULL };
-#endif
-    int exitstatus;
-
-    if (access(settleprog[0], 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 virNodeDeviceWaitForDevices(virConnectPtr conn ATTRIBUTE_UNUSED) {}
-#endif
-
-
 void registerCommonNodeFuncs(virDeviceMonitorPtr driver)
 {
     driver->numOfDevices = nodeNumOfDevices;
index 882ba0f5cdc357990f03303703e45293d035d95c..db016244efc8be536ebc6c6adf45d2d5176fa143 100644 (file)
@@ -53,6 +53,4 @@ void registerCommonNodeFuncs(virDeviceMonitorPtr mon);
 
 int nodedevRegister(void);
 
-void virNodeDeviceWaitForDevices(virConnectPtr conn);
-
 #endif /* __VIR_NODE_DEVICE_H__ */
index d731a23080be20696684bc9f29c7e227b656d551..953928e857960c5c5da00a63979ac073f888abee 100644 (file)
@@ -96,6 +96,32 @@ static virStorageBackendPtr backends[] = {
 };
 
 
+#if defined(UDEVADM) || defined(UDEVSETTLE)
+void virWaitForDevices(virConnectPtr conn)
+{
+#ifdef UDEVADM
+    const char *const settleprog[] = { UDEVADM, "settle", NULL };
+#else
+    const char *const settleprog[] = { UDEVSETTLE, NULL };
+#endif
+    int exitstatus;
+
+    if (access(settleprog[0], 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 virWaitForDevices(virConnectPtr conn ATTRIBUTE_UNUSED) {}
+#endif
+
+
 virStorageBackendPtr
 virStorageBackendForType(int type) {
     unsigned int i;
@@ -259,7 +285,7 @@ virStorageBackendUpdateVolTargetInfoFD(virConnectPtr conn,
 
 void virStorageBackendWaitForDevices(virConnectPtr conn)
 {
-    virNodeDeviceWaitForDevices(conn);
+    virWaitForDevices(conn);
     return;
 }
 
@@ -668,3 +694,4 @@ virStorageBackendRunProgNul(virConnectPtr conn,
     return -1;
 }
 #endif
+
index 7bf8814d3e2163b134d740f475c476e6f47a21c5..a3f441c48f2c698bd8c839cef76df703756237e0 100644 (file)
@@ -111,4 +111,6 @@ int virStorageBackendRunProgNul(virConnectPtr conn,
                                 virStorageBackendListVolNulFunc func,
                                 void *data);
 
+void virWaitForDevices(virConnectPtr conn);
+
 #endif /* __VIR_STORAGE_BACKEND_H__ */