conf: Add/Allow parsing the encryption in the disk source

Since the virStorageEncryptionPtr encryption; is a member of
 _virStorageSource it really should be allowed to be a subelement
of the disk <source> for various disk formats:

   Source{File|Dir|Block|Volume}
   SourceProtocol{RBD|ISCSI|NBD|Gluster|Simple|HTTP}

NB: Simple includes sheepdog, ftp, ftps, tftp

That way we can set up to allow the <encryption> element to be
formatted within the disk source, but we still need to be wary
from whence the element was read - see keep track and when it
comes to format the data, ensure it's written in the correct place.

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

The virschematest will read the new test files and validate from a
RNG viewpoint things are fine.
This commit is contained in:
John Ferlan
2017-09-14 09:32:57 -04:00
parent 8002d3cb1b
commit 37537a7c64
11 changed files with 420 additions and 10 deletions

View File

@@ -2712,6 +2712,14 @@
attribute matching the key that was specified in the
secret object.
</dd>
<dd><span class="since">Since libvirt 3.9.0</span>, the
<code>encryption</code> can be a sub-element of the
<code>source</code> element for encrypted storage sources.
If present, specifies how the storage source is encrypted
See the
<a href="formatstorageencryption.html">Storage Encryption</a>
page for more information.
</dd>
</dl>
<p>
@@ -3117,8 +3125,11 @@
<span class="since">Since 0.8.8</span>
</dd>
<dt><code>encryption</code></dt>
<dd>If present, specifies how the volume is encrypted. See
the <a href="formatstorageencryption.html">Storage Encryption</a> page
<dd>Starting with <span class="since">libvirt 3.9.0</span> the
<code>encryption</code> element is preferred to be a sub-element
of the <code>source</code> element. If present, specifies how the
volume is encrypted using "qcow". See the
<a href="formatstorageencryption.html">Storage Encryption</a> page
for more information.
</dd>
<dt><code>readonly</code></dt>