mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
conf: Rename API's in storage_adapter_conf
Rename the API's to remove the storage pool source pieces Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
f632e017c0
commit
1e21c04054
@ -38,7 +38,7 @@ VIR_ENUM_IMPL(virStoragePoolSourceAdapter,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virStoragePoolSourceAdapterClear(virStoragePoolSourceAdapterPtr adapter)
|
virStorageAdapterClear(virStoragePoolSourceAdapterPtr adapter)
|
||||||
{
|
{
|
||||||
if (adapter->type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST) {
|
if (adapter->type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST) {
|
||||||
VIR_FREE(adapter->data.fchost.wwnn);
|
VIR_FREE(adapter->data.fchost.wwnn);
|
||||||
@ -55,9 +55,9 @@ virStoragePoolSourceAdapterClear(virStoragePoolSourceAdapterPtr adapter)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolDefParseSourceAdapter(virStoragePoolSourcePtr source,
|
virStorageAdapterParseXML(virStoragePoolSourcePtr source,
|
||||||
xmlNodePtr node,
|
xmlNodePtr node,
|
||||||
xmlXPathContextPtr ctxt)
|
xmlXPathContextPtr ctxt)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
xmlNodePtr relnode = ctxt->node;
|
xmlNodePtr relnode = ctxt->node;
|
||||||
@ -177,7 +177,7 @@ virStoragePoolDefParseSourceAdapter(virStoragePoolSourcePtr source,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolSourceAdapterValidate(virStoragePoolDefPtr ret)
|
virStorageAdapterValidate(virStoragePoolDefPtr ret)
|
||||||
{
|
{
|
||||||
if (!ret->source.adapter.type) {
|
if (!ret->source.adapter.type) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
@ -253,8 +253,8 @@ virStoragePoolSourceAdapterValidate(virStoragePoolDefPtr ret)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virStoragePoolSourceAdapterFormat(virBufferPtr buf,
|
virStorageAdapterFormat(virBufferPtr buf,
|
||||||
virStoragePoolSourcePtr src)
|
virStoragePoolSourcePtr src)
|
||||||
{
|
{
|
||||||
virBufferAsprintf(buf, "<adapter type='%s'",
|
virBufferAsprintf(buf, "<adapter type='%s'",
|
||||||
virStoragePoolSourceAdapterTypeToString(src->adapter.type));
|
virStoragePoolSourceAdapterTypeToString(src->adapter.type));
|
||||||
|
@ -26,18 +26,18 @@
|
|||||||
# include "storage_conf.h"
|
# include "storage_conf.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
virStoragePoolSourceAdapterClear(virStoragePoolSourceAdapterPtr adapter);
|
virStorageAdapterClear(virStoragePoolSourceAdapterPtr adapter);
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolDefParseSourceAdapter(virStoragePoolSourcePtr source,
|
virStorageAdapterParseXML(virStoragePoolSourcePtr source,
|
||||||
xmlNodePtr node,
|
xmlNodePtr node,
|
||||||
xmlXPathContextPtr ctxt);
|
xmlXPathContextPtr ctxt);
|
||||||
|
|
||||||
int
|
int
|
||||||
virStoragePoolSourceAdapterValidate(virStoragePoolDefPtr ret);
|
virStorageAdapterValidate(virStoragePoolDefPtr ret);
|
||||||
|
|
||||||
void
|
void
|
||||||
virStoragePoolSourceAdapterFormat(virBufferPtr buf,
|
virStorageAdapterFormat(virBufferPtr buf,
|
||||||
virStoragePoolSourcePtr src);
|
virStoragePoolSourcePtr src);
|
||||||
|
|
||||||
#endif /* __VIR_STORAGE_ADAPTER_CONF_H__ */
|
#endif /* __VIR_STORAGE_ADAPTER_CONF_H__ */
|
||||||
|
@ -363,7 +363,7 @@ virStoragePoolSourceClear(virStoragePoolSourcePtr source)
|
|||||||
VIR_FREE(source->devices);
|
VIR_FREE(source->devices);
|
||||||
VIR_FREE(source->dir);
|
VIR_FREE(source->dir);
|
||||||
VIR_FREE(source->name);
|
VIR_FREE(source->name);
|
||||||
virStoragePoolSourceAdapterClear(&source->adapter);
|
virStorageAdapterClear(&source->adapter);
|
||||||
VIR_FREE(source->initiator.iqn);
|
VIR_FREE(source->initiator.iqn);
|
||||||
virStorageAuthDefFree(source->auth);
|
virStorageAuthDefFree(source->auth);
|
||||||
VIR_FREE(source->vendor);
|
VIR_FREE(source->vendor);
|
||||||
@ -565,7 +565,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((adapternode = virXPathNode("./adapter", ctxt))) {
|
if ((adapternode = virXPathNode("./adapter", ctxt))) {
|
||||||
if (virStoragePoolDefParseSourceAdapter(source, adapternode, ctxt) < 0)
|
if (virStorageAdapterParseXML(source, adapternode, ctxt) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -802,7 +802,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((options->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER) &&
|
if ((options->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER) &&
|
||||||
(virStoragePoolSourceAdapterValidate(ret)) < 0)
|
(virStorageAdapterValidate(ret)) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* If DEVICE is the only source type, then its required */
|
/* If DEVICE is the only source type, then its required */
|
||||||
@ -960,7 +960,7 @@ virStoragePoolSourceFormat(virBufferPtr buf,
|
|||||||
if ((options->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER) &&
|
if ((options->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER) &&
|
||||||
(src->adapter.type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST ||
|
(src->adapter.type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST ||
|
||||||
src->adapter.type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST))
|
src->adapter.type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST))
|
||||||
virStoragePoolSourceAdapterFormat(buf, src);
|
virStorageAdapterFormat(buf, src);
|
||||||
|
|
||||||
if (options->flags & VIR_STORAGE_POOL_SOURCE_NAME)
|
if (options->flags & VIR_STORAGE_POOL_SOURCE_NAME)
|
||||||
virBufferEscapeString(buf, "<name>%s</name>\n", src->name);
|
virBufferEscapeString(buf, "<name>%s</name>\n", src->name);
|
||||||
|
@ -848,10 +848,10 @@ virDomainSnapshotUpdateRelations;
|
|||||||
|
|
||||||
|
|
||||||
# conf/storage_adapter_conf.h
|
# conf/storage_adapter_conf.h
|
||||||
virStoragePoolDefParseSourceAdapter;
|
virStorageAdapterClear;
|
||||||
virStoragePoolSourceAdapterClear;
|
virStorageAdapterFormat;
|
||||||
virStoragePoolSourceAdapterFormat;
|
virStorageAdapterParseXML;
|
||||||
virStoragePoolSourceAdapterValidate;
|
virStorageAdapterValidate;
|
||||||
|
|
||||||
|
|
||||||
# conf/storage_conf.h
|
# conf/storage_conf.h
|
||||||
|
Loading…
Reference in New Issue
Block a user