[libvirt] [PATCH] Node Devices: Fix nodedev-list for fc_host & vports.

Prerna Saxena prerna at linux.vnet.ibm.com
Wed Aug 6 10:20:11 UTC 2014


In a system with Fiber Channel Host Adapters, a query to list all Fibre Channel
HBAs OR Vports currently returns empty list:
  $ virsh nodedev-list --cap fc_host

  $

Libvirt correctly discovers properties for all HBAs. However, the reporting
fails because of incorrect flag comparison while filtering these types.

This is fixed by removing references to 'VIR_CONNECT_LIST_NODE_DEVICES_CAP_*'
for comparison and replacing those with 'VIR_NODE_DEV_CAP_*'

Signed-off-by: Prerna Saxena <prerna at linux.vnet.ibm.com>
---
 src/conf/node_device_conf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 96524a6..025d08c 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1732,12 +1732,12 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr devobj,
             return true;
 
         if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST) {
-            if (type == VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST &&
+            if (type == VIR_NODE_DEV_CAP_FC_HOST &&
                 (cap->data.scsi_host.flags &
                  VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST))
                 return true;
 
-            if (type == VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS &&
+            if (type == VIR_NODE_DEV_CAP_VPORTS &&
                 (cap->data.scsi_host.flags &
                  VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS))
                 return true;
-- 
1.9.3

-- 
Prerna Saxena

Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India




More information about the libvir-list mailing list