提交 bb74a7ff 编写于 作者: J John Ferlan

conf: Add more fchost search fields for storage pool vHBA creation

Add new fields to the fchost structure to allow creation of a vHBA via
the storage pool when a parent_wwnn/parent_wwpn or parent_fabric_wwn is
supplied in the storage pool XML.
上级 2b13361b
......@@ -427,6 +427,21 @@
<ref name="virYesNo"/>
</attribute>
</optional>
<optional>
<attribute name='parent_wwnn'>
<ref name='wwn'/>
</attribute>
</optional>
<optional>
<attribute name='parent_wwpn'>
<ref name='wwn'/>
</attribute>
</optional>
<optional>
<attribute name='parent_fabric_wwn'>
<ref name='wwn'/>
</attribute>
</optional>
<attribute name='wwnn'>
<ref name='wwn'/>
</attribute>
......
......@@ -335,6 +335,9 @@ virStoragePoolSourceAdapterClear(virStoragePoolSourceAdapterPtr adapter)
VIR_FREE(adapter->data.fchost.wwnn);
VIR_FREE(adapter->data.fchost.wwpn);
VIR_FREE(adapter->data.fchost.parent);
VIR_FREE(adapter->data.fchost.parent_wwnn);
VIR_FREE(adapter->data.fchost.parent_wwpn);
VIR_FREE(adapter->data.fchost.parent_fabric_wwn);
} else if (adapter->type ==
VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) {
VIR_FREE(adapter->data.scsi_host.name);
......@@ -591,10 +594,17 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
}
}
source->adapter.data.fchost.wwnn =
virXPathString("string(./adapter/@wwnn)", ctxt);
source->adapter.data.fchost.parent_wwnn =
virXPathString("string(./adapter/@parent_wwnn)", ctxt);
source->adapter.data.fchost.parent_wwpn =
virXPathString("string(./adapter/@parent_wwpn)", ctxt);
source->adapter.data.fchost.parent_fabric_wwn =
virXPathString("string(./adapter/@parent_fabric_wwn)", ctxt);
source->adapter.data.fchost.wwpn =
virXPathString("string(./adapter/@wwpn)", ctxt);
source->adapter.data.fchost.wwnn =
virXPathString("string(./adapter/@wwnn)", ctxt);
} else if (source->adapter.type ==
VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) {
......@@ -1100,6 +1110,13 @@ virStoragePoolSourceFormat(virBufferPtr buf,
if (src->adapter.data.fchost.managed)
virBufferAsprintf(buf, " managed='%s'",
virTristateBoolTypeToString(src->adapter.data.fchost.managed));
virBufferEscapeString(buf, " parent_wwnn='%s'",
src->adapter.data.fchost.parent_wwnn);
virBufferEscapeString(buf, " parent_wwpn='%s'",
src->adapter.data.fchost.parent_wwpn);
virBufferEscapeString(buf, " parent_fabric_wwn='%s'",
src->adapter.data.fchost.parent_fabric_wwn);
virBufferAsprintf(buf, " wwnn='%s' wwpn='%s'/>\n",
src->adapter.data.fchost.wwnn,
src->adapter.data.fchost.wwpn);
......
......@@ -193,6 +193,9 @@ struct _virStoragePoolSourceAdapter {
} scsi_host;
struct {
char *parent;
char *parent_wwnn;
char *parent_wwpn;
char *parent_fabric_wwn;
char *wwnn;
char *wwpn;
int managed; /* enum virTristateSwitch */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册