[libvirt] [PATCH 09/10] util: storage: adapt to changes in JSON format for ssh
Pavel Hrdina
phrdina at redhat.com
Fri Jun 16 17:07:38 UTC 2017
On Fri, Jun 16, 2017 at 05:29:46PM +0200, Peter Krempa wrote:
> Since qemu 2.9 the options changed from a monolithic string into fine
> grained options for the json pseudo-protocol object.
> ---
> src/util/virstoragefile.c | 19 ++++++++++++-------
> tests/virstoragetest.c | 11 +++++++++++
> 2 files changed, 23 insertions(+), 7 deletions(-)
>
> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index 2526bac0b..dc06bec94 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -3083,8 +3083,9 @@ virStorageSourceParseBackingJSONSSH(virStorageSourcePtr src,
> const char *path = virJSONValueObjectGetString(json, "path");
> const char *host = virJSONValueObjectGetString(json, "host");
> const char *port = virJSONValueObjectGetString(json, "port");
> + virJSONValuePtr server = virJSONValueObjectGetObject(json, "server");
>
> - if (!host || !path) {
> + if (!(host || server) || !path) {
> virReportError(VIR_ERR_INVALID_ARG, "%s",
> _("missing host or path of SSH JSON backing "
> "volume definition"));
The error message could be updated as well.
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/3513fb1f/attachment-0001.sig>
More information about the libvir-list
mailing list