]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Add/Allow parsing the auth in the disk source
authorJohn Ferlan <jferlan@redhat.com>
Wed, 13 Sep 2017 14:25:25 +0000 (10:25 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 19 Oct 2017 19:26:49 +0000 (15:26 -0400)
commit8002d3cb1b1c3d34ab89cf5c4fb7611ad64140e4
tree692b4a2b7522b55e05c4f71bebbd276adfe9c3d0
parent0e2e22485ece66425da95ef4690f01af1c66f3cf
conf: Add/Allow parsing the auth in the disk source

Since the virStorageAuthDefPtr auth; is a member of _virStorageSource
it really should be allowed to be a subelement of the disk <source>
for the RBD and iSCSI prototcols. That way we can set up to allow
the <auth> element to be formatted within the disk source.

Since we've allowed the <auth> to be a child of <disk>, we'll need
to keep track of how it was read so that when writing out we'll know
whether to format as child of <disk> or <source>. For the argv2xml
parsing, let's format under <source> as a preference. Do not allow
<auth> to be both a child of <disk> and <source>.

Modify the qemuxml2argvtest to add a parse failure when there is an
<auth> as a child of <disk> *and* an <auth> as a child of <source>.

Add tests to validate that if the <auth> was found in <source>, then
the resulting xml2xml and xml2arg works just fine.  The two new .args
file are exact copies of the non "-source" version of the file.

The virschematest will read the new test files and validate from a
RNG viewpoint things are fine

Update the virstoragefile, virstoragetest, and args2xml file to show
the "preference" to place <auth> as a child of <source>.
13 files changed:
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/util/virstoragefile.c
src/util/virstoragefile.h
tests/qemuargv2xmldata/qemuargv2xml-disk-drive-network-rbd-auth.xml
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-source-auth-both.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-source-auth.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-source-auth.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-source-auth.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c
tests/virstoragetest.c