virjson: always raise vir error on append failures
A function that returns -1 for multiple possible failures, but only raises a libvirt error for some of those failures, can be hard to use correctly. Yet both of our JSON object/array appenders fall in that pattern. True, the silent errors represent coding bugs that none of the callers should ever trigger, while the noisy errors represent memory failures that can happen anywhere, so we happened to never end up failing without an error. But it is better to either use the _QUIET memory allocation variants, and make callers decide to report failure; or make all failure paths noisy. This patch takes the latter approach. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
Showing
想要评论请 注册 或 登录