]> xenbits.xensource.com Git - libvirt.git/commit
virStorageSourceParseNBDColonString: Rewrite to match what qemu does
authorPeter Krempa <pkrempa@redhat.com>
Fri, 24 Apr 2020 11:59:21 +0000 (13:59 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 27 Apr 2020 06:05:49 +0000 (08:05 +0200)
commitf8d6b319a6f033fea951a33fe069b573b2ed5b60
tree634b7ea241649c552891a6ca4d93f1d82e8173f4
parent6ebb00cd789478ef9017e3eb6b3db4260e57d4bb
virStorageSourceParseNBDColonString: Rewrite to match what qemu does

Our implementation wasn't quite able to parse everything that qemu does.
This patch rewrites the parser to a code that semantically resembles the
combination of 'nbd_parse_filename' and 'inet_parse' methods in qemu to
be able to parse the strings in an equivalent manner.

The only thing that libvirt doesn't do is to check the lengths of
various components in the nbd string in places where qemu uses constant
size buffers.

The test cases validate that some of the corner cases involving colons
are parsed properly.

https://bugzilla.redhat.com/show_bug.cgi?id=1826652

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/util/virstoragefile.c
tests/virstoragetest.c