提交 e0a31274 编写于 作者: M Michal Privoznik

network_conf: Expose virNetworkDefFormatInternal

In the next patch I'm going to need the network format function that
takes virBuffer as argument. However, slightly change of name is more
appropriate then: virNetworkDefFormatBuf to match the rest of functions
that format an object to buffer.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 5fc590ad
...@@ -2593,8 +2593,8 @@ cleanup: ...@@ -2593,8 +2593,8 @@ cleanup:
return ret; return ret;
} }
static int int
virNetworkDefFormatInternal(virBufferPtr buf, virNetworkDefFormatBuf(virBufferPtr buf,
const virNetworkDef *def, const virNetworkDef *def,
unsigned int flags) unsigned int flags)
{ {
...@@ -2763,7 +2763,7 @@ virNetworkDefFormat(const virNetworkDef *def, ...@@ -2763,7 +2763,7 @@ virNetworkDefFormat(const virNetworkDef *def,
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
if (virNetworkDefFormatInternal(&buf, def, flags) < 0) if (virNetworkDefFormatBuf(&buf, def, flags) < 0)
goto error; goto error;
if (virBufferError(&buf)) if (virBufferError(&buf))
...@@ -2794,7 +2794,7 @@ virNetworkObjFormat(virNetworkObjPtr net, ...@@ -2794,7 +2794,7 @@ virNetworkObjFormat(virNetworkObjPtr net,
VIR_FREE(class_id); VIR_FREE(class_id);
virBufferAdjustIndent(&buf, 2); virBufferAdjustIndent(&buf, 2);
if (virNetworkDefFormatInternal(&buf, net->def, flags) < 0) if (virNetworkDefFormatBuf(&buf, net->def, flags) < 0)
goto error; goto error;
virBufferAdjustIndent(&buf, -2); virBufferAdjustIndent(&buf, -2);
......
...@@ -338,6 +338,9 @@ virNetworkDefPtr virNetworkDefParseFile(const char *filename); ...@@ -338,6 +338,9 @@ virNetworkDefPtr virNetworkDefParseFile(const char *filename);
virNetworkDefPtr virNetworkDefParseNode(xmlDocPtr xml, virNetworkDefPtr virNetworkDefParseNode(xmlDocPtr xml,
xmlNodePtr root); xmlNodePtr root);
char *virNetworkDefFormat(const virNetworkDef *def, unsigned int flags); char *virNetworkDefFormat(const virNetworkDef *def, unsigned int flags);
int virNetworkDefFormatBuf(virBufferPtr buf,
const virNetworkDef *def,
unsigned int flags);
static inline const char * static inline const char *
virNetworkDefForwardIf(const virNetworkDef *def, size_t n) virNetworkDefForwardIf(const virNetworkDef *def, size_t n)
......
...@@ -505,6 +505,7 @@ virNetworkConfigChangeSetup; ...@@ -505,6 +505,7 @@ virNetworkConfigChangeSetup;
virNetworkConfigFile; virNetworkConfigFile;
virNetworkDefCopy; virNetworkDefCopy;
virNetworkDefFormat; virNetworkDefFormat;
virNetworkDefFormatBuf;
virNetworkDefFree; virNetworkDefFree;
virNetworkDefGetIpByIndex; virNetworkDefGetIpByIndex;
virNetworkDefParseFile; virNetworkDefParseFile;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册