]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: storage: Add parser for qemu's json backing pseudo-protocol
authorPeter Krempa <pkrempa@redhat.com>
Fri, 8 Apr 2016 07:55:46 +0000 (09:55 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 27 Jul 2016 11:24:20 +0000 (13:24 +0200)
commite91f767c7433d9216c741f441196cd67c1934375
treef2c336f6e7f9cef1b2fcf4708ee518c6cef26c01
parent22ad4a7c0a546ca156f5a5b18ad2fcd6a699442c
util: storage: Add parser for qemu's json backing pseudo-protocol

Add a modular parser that will allow to parse 'json' backing definitions
that are supported by qemu. The initial implementation adds support for
the 'file' driver.

Due to the approach qemu took to implement the JSON backing strings it's
possible to specify them in two approaches.

The object approach:
    json:{ "file" : { "driver":"file",
                      "filename":"/path/to/file"
                    }
         }

And a partially flattened approach:
    json:{"file.driver":"file"
          "file.filename":"/path/to/file"
         }

Both of the above are supported by qemu and by the code added in this
commit. The current implementation de-flattens the first level ('file.')
if possible and required. Other handling may be added later but
currently only one level was possible anyways.
src/util/virstoragefile.c
tests/virstoragetest.c