From 97af511b1a1cd49a7a5ffcdc3975a72239a7afdc Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Wed, 18 Jun 2014 14:13:26 +0200 Subject: [PATCH] vbox_snapshot_conf: fix wrong use of 'xmlSaveFormatFileEnc' The function 'xmlSaveFormatFileEnc' has a last option to set if you want to format dumped xml with whitespaces or not. Older libxml2, the one used in RHEL6, take this option as it is but newer libxml2 check this option if it's true or not. This small difference somehow makes things messy on RHEL6 and generated xml had extra new line and extra whitespaces. We should pass 1 instead if -1 because the -1 confuses the libxml2. Signed-off-by: Pavel Hrdina --- src/vbox/vbox_snapshot_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 3f7ad78e0e..7af1231a91 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src/vbox/vbox_snapshot_conf.c @@ -1211,7 +1211,7 @@ virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine, } } - if (xmlSaveFormatFileEnc(filePath, xml, "ISO-8859-1", -1) < 0) { + if (xmlSaveFormatFileEnc(filePath, xml, "ISO-8859-1", 1) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Unable to save the xml")); goto cleanup; -- GitLab