On Thu, Oct 05, 2017 at 09:22:08 -0400, John Ferlan wrote:
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>.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
docs/formatdomain.html.in | 67 +++++++++++++---------
docs/schemas/domaincommon.rng | 18 +++++-
src/conf/domain_conf.c | 67 +++++++++++++++++++++-
src/util/virstoragefile.c | 1 +
src/util/virstoragefile.h | 1 +
.../qemuargv2xml-disk-drive-network-rbd-auth.xml | 6 +-
...ml2argv-disk-drive-network-source-auth-both.xml | 51 ++++++++++++++++
...emuxml2argv-disk-drive-network-source-auth.args | 32 +++++++++++
...qemuxml2argv-disk-drive-network-source-auth.xml | 45 +++++++++++++++
tests/qemuxml2argvtest.c | 2 +
...muxml2xmlout-disk-drive-network-source-auth.xml | 49 ++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
tests/virstoragetest.c | 6 ++
13 files changed, 311 insertions(+), 35 deletions(-)
create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-source-auth-both.xml
create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-source-auth.args
create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-source-auth.xml
create mode 100644
tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-source-auth.xml
[...]
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index c0e3c22213..74f2090d06 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index 74dee10f2f..c8bb1066fe 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -238,6 +238,7 @@ struct _virStorageSource {
virStorageNetHostDefPtr hosts;
virStorageSourcePoolDefPtr srcpool;
virStorageAuthDefPtr auth;
+ bool authDefined;
I find this name slightly misleading. How about authInherited?
At any rate, this patch should be applicable without conflicts and it
will help in doing security related stuff for the backing chain.
ACK
You can push this right now. I'll pick out a few other things form this
series which will be helpful for the blockdev-add saga and pass back the
rest for the iSCSI work (mainly with pre-blockdev qemus).