[libvirt] [PATCH] Make virDomainObjParseNode() static

Make virDomainObjParseNode() static since it is called only in one file. --- src/conf/domain_conf.c | 38 ++++++++++++++++++++------------------ src/conf/domain_conf.h | 3 --- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 16e1291..c637300 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6081,24 +6081,10 @@ cleanup: } -virDomainObjPtr virDomainObjParseFile(virCapsPtr caps, - const char *filename) -{ - xmlDocPtr xml; - virDomainObjPtr obj = NULL; - - if ((xml = virXMLParseFile(filename))) { - obj = virDomainObjParseNode(caps, xml, xmlDocGetRootElement(xml)); - xmlFreeDoc(xml); - } - - return obj; -} - - -virDomainObjPtr virDomainObjParseNode(virCapsPtr caps, - xmlDocPtr xml, - xmlNodePtr root) +static virDomainObjPtr +virDomainObjParseNode(virCapsPtr caps, + xmlDocPtr xml, + xmlNodePtr root) { xmlXPathContextPtr ctxt = NULL; virDomainObjPtr obj = NULL; @@ -6123,6 +6109,22 @@ cleanup: return obj; } + +virDomainObjPtr virDomainObjParseFile(virCapsPtr caps, + const char *filename) +{ + xmlDocPtr xml; + virDomainObjPtr obj = NULL; + + if ((xml = virXMLParseFile(filename))) { + obj = virDomainObjParseNode(caps, xml, xmlDocGetRootElement(xml)); + xmlFreeDoc(xml); + } + + return obj; +} + + static int virDomainDefMaybeAddController(virDomainDefPtr def, int type, int idx) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 30aeccc..cbd0f98 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1246,9 +1246,6 @@ virDomainDefPtr virDomainDefParseNode(virCapsPtr caps, virDomainObjPtr virDomainObjParseFile(virCapsPtr caps, const char *filename); -virDomainObjPtr virDomainObjParseNode(virCapsPtr caps, - xmlDocPtr xml, - xmlNodePtr root); int virDomainDefAddImplicitControllers(virDomainDefPtr def); -- 1.7.3.1

On 03/16/2011 01:03 AM, Hu Tao wrote:
Make virDomainObjParseNode() static since it is called only in one file. --- src/conf/domain_conf.c | 38 ++++++++++++++++++++------------------ src/conf/domain_conf.h | 3 --- 2 files changed, 20 insertions(+), 21 deletions(-)
That seemed like a lot of churn, until I realized:
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 16e1291..c637300 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6081,24 +6081,10 @@ cleanup: }
-virDomainObjPtr virDomainObjParseFile(virCapsPtr caps, - const char *filename)
Oh, you also did code motion in the same patch, moving this function down (or the other one up - diff can't quite tell the difference) to preserve topological use. ACK and pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Hu Tao