]> xenbits.xensource.com Git - libvirt.git/commit
util: storagefile: Properly set transport type when parsing NBD strings
authorPeter Krempa <pkrempa@redhat.com>
Thu, 16 Jan 2020 11:34:13 +0000 (12:34 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 17 Jan 2020 11:34:10 +0000 (12:34 +0100)
commit5f2fa393f721861132500f717ce509bb66afcdb7
tree39792d953336b60d0392848f033222166c0601b5
parent9bb3571f10880eb92e0d7b0bcc47ee862d969b90
util: storagefile: Properly set transport type when parsing NBD strings

When parsing legacy NBD backing file strings such as
'nbd:unix:/tmp/sock:exportname=/' we'd fail to set the transport to
VIR_STORAGE_NET_HOST_TRANS_UNIX. This started to be a problem once we
actually started to generate config of the backing store on the command
line with -blockdev as the JSON code would try to format it as TCP and
fail with:

 internal error: argument key 'host' must not have null value

Set the type properly and add a test.

This bug was found by the libguestfs test suite in:

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reported-by: Ming Xie <mxie@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
src/util/virstoragefile.c
tests/virstoragetest.c