diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in index 126f8de5cb..c04d04d1c2 100644 --- a/docs/formatnode.html.in +++ b/docs/formatnode.html.in @@ -126,6 +126,7 @@
A network protocol exposed by the device, where the attribute type can be "80203" for IEEE 802.3, or "80211" for various flavors of IEEE 802.11. +
scsi_host
@@ -133,6 +134,12 @@
host
The SCSI host number.
+
capability
+
Current capabilities include "vports_ops" (indicates + vport operations are supported) and "fc_host", the later + implies following sub-elements: wwnn, + wwpn, fabric_wwn. +
scsi
diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng index 55191d990a..1b9a2d1226 100644 --- a/docs/schemas/nodedev.rng +++ b/docs/schemas/nodedev.rng @@ -216,6 +216,35 @@ + + + (0-9a-fA-F){16} + + + + + + fc_host + + + + + + + + + + + + + + + + + + vports_ops + + @@ -225,6 +254,17 @@ + + + + + + + + + + + diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 084121f26d..d9dc9ac777 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -396,6 +396,8 @@ char *virNodeDeviceDefFormat(const virNodeDeviceDefPtr def) data->scsi_host.wwnn); virBufferEscapeString(&buf, " %s\n", data->scsi_host.wwpn); + virBufferEscapeString(&buf, " %s\n", + data->scsi_host.fabric_wwn); virBufferAddLit(&buf, " \n"); } if (data->scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS) { @@ -1378,6 +1380,7 @@ void virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) case VIR_NODE_DEV_CAP_SCSI_HOST: VIR_FREE(data->scsi_host.wwnn); VIR_FREE(data->scsi_host.wwpn); + VIR_FREE(data->scsi_host.fabric_wwn); break; case VIR_NODE_DEV_CAP_SCSI_TARGET: VIR_FREE(data->scsi_target.name); diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 17be0313a3..a1833a0e62 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -141,6 +141,7 @@ struct _virNodeDevCapsDef { unsigned int host; char *wwnn; char *wwpn; + char *fabric_wwn; unsigned int flags; } scsi_host; struct { diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c index d3528007b5..380be9c61b 100644 --- a/src/node_device/node_device_linux_sysfs.c +++ b/src/node_device/node_device_linux_sysfs.c @@ -149,10 +149,20 @@ int check_fc_host_linux(union _virNodeDevCapData *d) retval = -1; } + if (read_wwn(d->scsi_host.host, + "fabric_name", + &d->scsi_host.fabric_wwn) == -1) { + VIR_ERROR(_("Failed to read fabric WWN for host%d"), + d->scsi_host.host); + retval = -1; + goto out; + } + out: if (retval == -1) { VIR_FREE(d->scsi_host.wwnn); VIR_FREE(d->scsi_host.wwpn); + VIR_FREE(d->scsi_host.fabric_wwn); } VIR_FREE(sysfs_path); return retval;