mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virTestLoadFileJSON: Don't try to unwrap JSON documents
Use virFileReadAll to load the file instead of virTestLoadFile which tries to unwrap the file. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
@@ -313,7 +313,7 @@ virTestLoadFileJSON(const char *p, ...)
|
||||
if (!(path = virTestLoadFileGetPath(p, ap)))
|
||||
goto cleanup;
|
||||
|
||||
if (virTestLoadFile(path, &jsonstr) < 0)
|
||||
if (virFileReadAll(path, INT_MAX, &jsonstr) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(ret = virJSONValueFromString(jsonstr)))
|
||||
|
||||
Reference in New Issue
Block a user