util: replace all calls to xmlNodeGetContent with virXMLNodeContentString

No functional change

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Laine Stump 2020-07-14 00:21:28 -04:00
parent b595f44525
commit c42e161000
3 changed files with 13 additions and 13 deletions

View File

@ -1650,7 +1650,7 @@ virDomainBlkioDeviceParseXML(xmlNodePtr root,
if (node->type != XML_ELEMENT_NODE)
continue;
c = (char *)xmlNodeGetContent(node);
c = virXMLNodeContentString(node);
if (virXMLNodeNameEqual(node, "path")) {
/* To avoid the need for explicit cleanup on failure,
@ -9377,10 +9377,10 @@ virDomainLeaseDefParseXML(xmlNodePtr node)
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
if (!key && virXMLNodeNameEqual(cur, "key")) {
key = (char *)xmlNodeGetContent(cur);
key = virXMLNodeContentString(cur);
} else if (!lockspace &&
virXMLNodeNameEqual(cur, "lockspace")) {
lockspace = (char *)xmlNodeGetContent(cur);
lockspace = virXMLNodeContentString(cur);
} else if (!path &&
virXMLNodeNameEqual(cur, "target")) {
path = virXMLPropString(cur, "path");
@ -10599,16 +10599,16 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
} else if (!serial &&
virXMLNodeNameEqual(cur, "serial")) {
serial = (char *)xmlNodeGetContent(cur);
serial = virXMLNodeContentString(cur);
} else if (!wwn &&
virXMLNodeNameEqual(cur, "wwn")) {
wwn = (char *)xmlNodeGetContent(cur);
wwn = virXMLNodeContentString(cur);
if (!virValidateWWN(wwn))
goto error;
} else if (!vendor &&
virXMLNodeNameEqual(cur, "vendor")) {
vendor = (char *)xmlNodeGetContent(cur);
vendor = virXMLNodeContentString(cur);
if (strlen(vendor) > VENDOR_LEN) {
virReportError(VIR_ERR_XML_ERROR, "%s",
@ -10623,7 +10623,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
}
} else if (!product &&
virXMLNodeNameEqual(cur, "product")) {
product = (char *)xmlNodeGetContent(cur);
product = virXMLNodeContentString(cur);
if (strlen(product) > PRODUCT_LEN) {
virReportError(VIR_ERR_XML_ERROR, "%s",
@ -13529,7 +13529,7 @@ virDomainSmartcardDefParseXML(virDomainXMLOptionPtr xmlopt,
"exactly three certificates"));
goto error;
}
def->data.cert.file[i] = (char *)xmlNodeGetContent(cur);
def->data.cert.file[i] = virXMLNodeContentString(cur);
if (!def->data.cert.file[i]) {
virReportOOMError();
goto error;
@ -13538,7 +13538,7 @@ virDomainSmartcardDefParseXML(virDomainXMLOptionPtr xmlopt,
} else if (cur->type == XML_ELEMENT_NODE &&
virXMLNodeNameEqual(cur, "database") &&
!def->data.cert.database) {
def->data.cert.database = (char *)xmlNodeGetContent(cur);
def->data.cert.database = virXMLNodeContentString(cur);
if (!def->data.cert.database) {
virReportOOMError();
goto error;
@ -19904,7 +19904,7 @@ virDomainLoaderDefParseXML(xmlNodePtr node,
if (!fwAutoSelect) {
readonly_str = virXMLPropString(node, "readonly");
type_str = virXMLPropString(node, "type");
loader->path = (char *) xmlNodeGetContent(node);
loader->path = virXMLNodeContentString(node);
if (STREQ_NULLABLE(loader->path, ""))
VIR_FREE(loader->path);
}

View File

@ -720,7 +720,7 @@ virNetworkDNSHostDefParseXML(const char *networkName,
if (cur->type == XML_ELEMENT_NODE &&
virXMLNodeNameEqual(cur, "hostname")) {
if (cur->children != NULL) {
g_autofree char *name = (char *) xmlNodeGetContent(cur);
g_autofree char *name = virXMLNodeContentString(cur);
if (!name) {
virReportError(VIR_ERR_XML_DETAIL,

View File

@ -1986,10 +1986,10 @@ virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt,
switch ((virNodeDevDevnodeType)val) {
case VIR_NODE_DEV_DEVNODE_DEV:
def->devnode = (char*)xmlNodeGetContent(node);
def->devnode = virXMLNodeContentString(node);
break;
case VIR_NODE_DEV_DEVNODE_LINK:
def->devlinks[m++] = (char*)xmlNodeGetContent(node);
def->devlinks[m++] = virXMLNodeContentString(node);
break;
case VIR_NODE_DEV_DEVNODE_LAST:
break;