[PATCH] util: xml: remove unused function virXMLChildElementCount

Yi Li posted 1 patch 3 years, 5 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20201105232000.3524028-1-yili@winhong.com
src/libvirt_private.syms |  1 -
src/util/virxml.c        | 21 ---------------------
src/util/virxml.h        |  1 -
3 files changed, 23 deletions(-)
[PATCH] util: xml: remove unused function virXMLChildElementCount
Posted by Yi Li 3 years, 5 months ago
---
 src/libvirt_private.syms |  1 -
 src/util/virxml.c        | 21 ---------------------
 src/util/virxml.h        |  1 -
 3 files changed, 23 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 9029ea4fa2..36ab84162c 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3504,7 +3504,6 @@ virVsockSetGuestCid;
 # util/virxml.h
 virParseScaledValue;
 virXMLCheckIllegalChars;
-virXMLChildElementCount;
 virXMLExtractNamespaceXML;
 virXMLFormatElement;
 virXMLNodeContentString;
diff --git a/src/util/virxml.c b/src/util/virxml.c
index 8a94de8fe4..a3b819d85c 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -934,27 +934,6 @@ virXMLSaveFile(const char *path,
     return virFileRewrite(path, S_IRUSR | S_IWUSR, virXMLRewriteFile, &data);
 }
 
-/* Returns the number of children of node, or -1 on error.  */
-long
-virXMLChildElementCount(xmlNodePtr node)
-{
-    long ret = 0;
-    xmlNodePtr cur = NULL;
-
-    /* xmlChildElementCount returns 0 on error, which isn't helpful;
-     * besides, it is not available in libxml2 2.6.  */
-    if (!node || node->type != XML_ELEMENT_NODE)
-        return -1;
-    cur = node->children;
-    while (cur) {
-        if (cur->type == XML_ELEMENT_NODE)
-            ret++;
-        cur = cur->next;
-    }
-    return ret;
-}
-
-
 /**
  * virXMLNodeToString: convert an XML node ptr to an XML string
  *
diff --git a/src/util/virxml.h b/src/util/virxml.h
index b73591c3df..f73b8975ba 100644
--- a/src/util/virxml.h
+++ b/src/util/virxml.h
@@ -77,7 +77,6 @@ char *     virXMLPropStringLimit(xmlNodePtr node,
                                  const char *name,
                                  size_t maxlen);
 char *   virXMLNodeContentString(xmlNodePtr node);
-long     virXMLChildElementCount(xmlNodePtr node);
 
 /* Internal function; prefer the macros below.  */
 xmlDocPtr      virXMLParseHelper(int domcode,
-- 
2.25.3




Re: [PATCH] util: xml: remove unused function virXMLChildElementCount
Posted by Ján Tomko 3 years, 5 months ago
On a Friday in 2020, Yi Li wrote:
>---
> src/libvirt_private.syms |  1 -
> src/util/virxml.c        | 21 ---------------------
> src/util/virxml.h        |  1 -
> 3 files changed, 23 deletions(-)
>

Looks good, but it's missing a sign-off.

Can you, please, include a Signed-off-by line to indicate you complied
with the Developer Certificate of Origin?

https://libvirt.org/hacking.html#developer-certificate-of-origin

Replying to this e-mail with the line is enough, no need to resend the
patch.

Jano
Re: [PATCH] util: xml: remove unused function virXMLChildElementCount
Posted by Yi Li 3 years, 5 months ago
On 11/6/20, Ján Tomko <jtomko@redhat.com> wrote:
> On a Friday in 2020, Yi Li wrote:
>>---
>> src/libvirt_private.syms |  1 -
>> src/util/virxml.c        | 21 ---------------------
>> src/util/virxml.h        |  1 -
>> 3 files changed, 23 deletions(-)
>>
>
> Looks good, but it's missing a sign-off.
>
> Can you, please, include a Signed-off-by line to indicate you complied
> with the Developer Certificate of Origin?
>

Signed-off-by: Yi Li <yili@winhong.com>

> https://libvirt.org/hacking.html#developer-certificate-of-origin
>
> Replying to this e-mail with the line is enough, no need to resend the
> patch.
>

Thanks

> Jano
>


Re: [PATCH] util: xml: remove unused function virXMLChildElementCount
Posted by Ján Tomko 3 years, 5 months ago
On a Friday in 2020, Yi Li wrote:
>On 11/6/20, Ján Tomko <jtomko@redhat.com> wrote:
>> On a Friday in 2020, Yi Li wrote:
>>>---
>>> src/libvirt_private.syms |  1 -
>>> src/util/virxml.c        | 21 ---------------------
>>> src/util/virxml.h        |  1 -
>>> 3 files changed, 23 deletions(-)
>>>
>>
>> Looks good, but it's missing a sign-off.
>>
>> Can you, please, include a Signed-off-by line to indicate you complied
>> with the Developer Certificate of Origin?
>>
>
>Signed-off-by: Yi Li <yili@winhong.com>
>

Thanks, pushed now.

Jano