]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virconf: properly set the end of content
authorJim Fehlig <jfehlig@suse.com>
Tue, 7 Nov 2017 21:20:44 +0000 (14:20 -0700)
committerJim Fehlig <jfehlig@suse.com>
Thu, 9 Nov 2017 15:04:26 +0000 (08:04 -0700)
commit299e97c4e8a4be53538f1ac6e68c3f5f24efa375
tree0b6785a2c3ffa1d261850550746404de8c270c6d
parent5af63c9aa32e9bb8b896d7c404fe28e82f900f03
virconf: properly set the end of content

There was a recent report of the xen-xl converter not handling
config files missing an ending newline

https://www.redhat.com/archives/libvir-list/2017-October/msg01353.html

Commit 3cc2a9e0 fixed a similar problem when parsing content of a
file but missed parsing in-memory content. But AFAICT, the better
fix is to properly set the end of the content when initializing the
virConfParserCtxt in virConfParse().

This commit reverts the part of 3cc2a9e0 that appends a newline to
files missing it, and fixes setting the end of content when
initializing virConfParserCtxt. A test is also added to check
parsing in-memory content missing an ending newline.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
src/util/virconf.c
tests/virconftest.c