Re: [PATCH 09/10] util: storage: adapt to changes in JSON format for ssh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux