mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
virxml: Report error if virXMLFormatMetadata() fails
I guess this is more of an academic problem, because if <metadata/> content was problematic we would have caught the error during parsing. Anyway, as is this function returns -1 without any error reported. Fix it by reporting one. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
c380ae220e
commit
2c6402c635
@ -1740,6 +1740,8 @@ virXMLFormatMetadata(virBuffer *buf,
|
||||
if (xmlNodeDump(xmlbuf, metadata->doc, metadata,
|
||||
virBufferGetIndent(buf) / 2, 1) < 0) {
|
||||
xmlIndentTreeOutput = oldIndentTreeOutput;
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Unable to format metadata element"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user