]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: storage: Parse 'lun' for iSCSI protocol from JSON as string or number
authorPeter Krempa <pkrempa@redhat.com>
Wed, 31 Jan 2018 11:00:42 +0000 (12:00 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 31 Jan 2018 11:22:25 +0000 (12:22 +0100)
commitf46d6e22f2dc352cd43480c1d148222f4e62b8e6
tree3bfb36de12bcf917ec03e5098516b2dbd6e21549
parentd3da8013cc11d6a10d4a4146bcbb0a7e34523fa5
util: storage: Parse 'lun' for iSCSI protocol from JSON as string or number

While the QEMU QAPI schema describes 'lun' as a number, the code dealing
with JSON strings does not strictly adhere to this schema and thus
formats the number back as a string. Use the new helper to retrieve both
possibilities.

Note that the formatting code is okay and qemu will accept it as an int.

Tweak also one of the test strings to verify that both formats work
with libvirt.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1540290
src/util/virstoragefile.c
tests/virstoragetest.c