[PATCH 03/12] nodedev: Implement virNodeDeviceFindByWWN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This just simply changes nodeDeviceFindByWWN to be not static,
and use that for udev and HAL backends.
---
 src/node_device/node_device_driver.c |    9 ++++++---
 src/node_device/node_device_driver.h |    4 ++++
 src/node_device/node_device_hal.c    |    1 +
 src/node_device/node_device_udev.c   |    1 +
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 522af99..6134507 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -224,10 +224,11 @@ cleanup:
 }
 
 
-static virNodeDevicePtr
+virNodeDevicePtr
 nodeDeviceLookupByWWN(virConnectPtr conn,
                       const char *wwnn,
-                      const char *wwpn)
+                      const char *wwpn,
+                      unsigned int flags)
 {
     unsigned int i;
     virDeviceMonitorStatePtr driver = conn->devMonPrivateData;
@@ -236,6 +237,8 @@ nodeDeviceLookupByWWN(virConnectPtr conn,
     virNodeDeviceObjPtr obj = NULL;
     virNodeDevicePtr dev = NULL;
 
+    virCheckFlags(0, NULL);
+
     nodeDeviceLock(driver);
 
     for (i = 0; i < devs->count; i++) {
@@ -546,7 +549,7 @@ find_new_device(virConnectPtr conn, const char *wwnn, const char *wwpn)
 
         virFileWaitForDevices();
 
-        dev = nodeDeviceLookupByWWN(conn, wwnn, wwpn);
+        dev = nodeDeviceLookupByWWN(conn, wwnn, wwpn, 0);
 
         if (dev != NULL) {
             break;
diff --git a/src/node_device/node_device_driver.h b/src/node_device/node_device_driver.h
index 4cec07c..26f0550 100644
--- a/src/node_device/node_device_driver.h
+++ b/src/node_device/node_device_driver.h
@@ -77,6 +77,10 @@ int nodeListAllNodeDevices(virConnectPtr conn,
                            virNodeDevicePtr **devices,
                            unsigned int flags);
 virNodeDevicePtr nodeDeviceLookupByName(virConnectPtr conn, const char *name);
+virNodeDevicePtr nodeDeviceLookupByWWN(virConnectPtr conn,
+                                       const char *wwnn,
+                                       const char *wwpn,
+                                       unsigned int flags);
 char *nodeDeviceGetXMLDesc(virNodeDevicePtr dev, unsigned int flags);
 char *nodeDeviceGetParent(virNodeDevicePtr dev);
 int nodeDeviceNumOfCaps(virNodeDevicePtr dev);
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index 610df8d..33e0170 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -765,6 +765,7 @@ static virDeviceMonitor halDeviceMonitor = {
     .listDevices = nodeListDevices, /* 0.5.0 */
     .listAllNodeDevices = nodeListAllNodeDevices, /* 0.10.2 */
     .deviceLookupByName = nodeDeviceLookupByName, /* 0.5.0 */
+    .deviceLookupByWWN = nodeDeviceLookupByWWN, /* 1.0.2 */
     .deviceGetXMLDesc = nodeDeviceGetXMLDesc, /* 0.5.0 */
     .deviceGetParent = nodeDeviceGetParent, /* 0.5.0 */
     .deviceNumOfCaps = nodeDeviceNumOfCaps, /* 0.5.0 */
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index a9b30b2..4137488 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1754,6 +1754,7 @@ static virDeviceMonitor udevDeviceMonitor = {
     .listDevices = nodeListDevices, /* 0.7.3 */
     .listAllNodeDevices = nodeListAllNodeDevices, /* 0.10.2 */
     .deviceLookupByName = nodeDeviceLookupByName, /* 0.7.3 */
+    .deviceLookupByWWN = nodeDeviceLookupByWWN, /* 1.0.2 */
     .deviceGetXMLDesc = nodeDeviceGetXMLDesc, /* 0.7.3 */
     .deviceGetParent = nodeDeviceGetParent, /* 0.7.3 */
     .deviceNumOfCaps = nodeDeviceNumOfCaps, /* 0.7.3 */
-- 
1.7.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]