[libvirt] [PATCH 05/10] util: storage: Report errors when source host data is missing
Pavel Hrdina
phrdina at redhat.com
Fri Jun 16 16:03:50 UTC 2017
On Fri, Jun 16, 2017 at 05:29:42PM +0200, Peter Krempa wrote:
> Merge the reporting of the missing source host data into the parser
> functions so that callers don't have to do it separately.
> ---
> src/util/virstoragefile.c | 30 ++++++++++++++++++++++++------
> 1 file changed, 24 insertions(+), 6 deletions(-)
>
> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index c7632808e..c0aa4e4c6 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
[...]
> @@ -2839,14 +2858,13 @@ virStorageSourceParseBackingJSONSocketAddress(virStorageNetHostDefPtr host,
> return virStorageSourceParseBackingJSONInetSocketAddress(host, json);
>
> case VIR_STORAGE_NET_HOST_TRANS_UNIX:
> - if (!socket) {
> + if (!(socket = virJSONValueObjectGetString(json, "socket"))) {
> virReportError(VIR_ERR_INVALID_ARG, "%s",
> _("missing socket path for udp backing server in "
> "JSON backing volume definition"));
> return -1;
> }
>
> -
Spurious line removal :)
> if (VIR_STRDUP(host->socket, socket) < 0)
> return -1;
Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170616/1b09584f/attachment-0001.sig>
More information about the libvir-list
mailing list