qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [libvirt] [libvirt RFC PATCH 04/10] util: storage: Add


From: Eric Blake
Subject: Re: [Qemu-block] [libvirt] [libvirt RFC PATCH 04/10] util: storage: Add support for URI based backing volumes in qemu's JSON pseudo-protocol
Date: Wed, 27 Jul 2016 21:04:08 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 07/15/2016 07:46 AM, Peter Krempa wrote:
> http(s), ftp(s) and tftp use URIs for volume definitions in the JSON
> pseudo protocol so it's pretty straightforward to add support for them.
> ---
>  src/util/virstoragefile.c | 34 ++++++++++++++++++++++++++++++++++
>  tests/virstoragetest.c    |  8 ++++++++
>  2 files changed, 42 insertions(+)

Still might be nice to include an example in the commit message, not
just the testsuite addition.

I know that qemu is hoping to move away from URI towards more structured
layouts as part of adding blockdev-add support for these drivers (back
to your observation that once qemu supports two ways, it will have to
continue to support both types of users).  That means we may need more
code to parse non-URI (but better-structured) uses, but we'd still need
this uri parsing.


> +++ b/tests/virstoragetest.c
> @@ -1367,6 +1367,14 @@ mymain(void)
>      TEST_BACKING_PARSE(12, "json:{\"file.driver\":\"host_cdrom\", "
>                                   "\"file.filename\":\"/path/to/cdrom\"}",
>                         "<source dev='/path/to/cdrom'/>\n");
> +    TEST_BACKING_PARSE(13, "json:{\"file.driver\":\"http\", "
> +                                 "\"file.uri\":\"http://example.com/file\"}";,
> +                       "<source protocol='http' name='file'>\n"
> +                       "  <host name='example.com'/>\n"
> +                       "</source>\n");
> +    TEST_BACKING_PARSE(14, "json:{\"file.driver\":\"ftp\", "
> +                                 "\"file.uri\":\"http://example.com/file\"}";,
> +                       NULL);
> 

On the bright side, this patch made it look fairly simple, which means
we have good reuse of code.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]