提交 cd317093 编写于 作者: P Peter Krempa

util: storage: Add helpers to parse and format relPath into privateData

This will be the first private piece of data that will need to be stored
in the XML for some drivers. Add helpers which will do it.
上级 aed3d038
......@@ -2734,6 +2734,8 @@ virStorageSourceParseRBDColonString;
virStorageSourcePoolDefFree;
virStorageSourcePoolModeTypeFromString;
virStorageSourcePoolModeTypeToString;
virStorageSourcePrivateDataFormatRelPath;
virStorageSourcePrivateDataParseRelPath;
virStorageSourceUpdateBackingSizes;
virStorageSourceUpdateCapacity;
virStorageSourceUpdatePhysicalSize;
......
......@@ -4086,3 +4086,23 @@ virStorageSourceNetworkAssignDefaultPorts(virStorageSourcePtr src)
src->hosts[i].port = virStorageSourceNetworkDefaultPort(src->protocol);
}
}
int
virStorageSourcePrivateDataParseRelPath(xmlXPathContextPtr ctxt,
virStorageSourcePtr src)
{
src->relPath = virXPathString("string(./relPath)", ctxt);
return 0;
}
int
virStorageSourcePrivateDataFormatRelPath(virStorageSourcePtr src,
virBufferPtr buf)
{
if (src->relPath)
virBufferEscapeString(buf, "<relPath>%s</relPath>\n", src->relPath);
return 0;
}
......@@ -441,4 +441,12 @@ bool
virStorageSourceHasBacking(const virStorageSource *src);
int
virStorageSourcePrivateDataParseRelPath(xmlXPathContextPtr ctxt,
virStorageSourcePtr src);
int
virStorageSourcePrivateDataFormatRelPath(virStorageSourcePtr src,
virBufferPtr buf);
#endif /* __VIR_STORAGE_FILE_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册