[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v3 1/4] docs: schema: Add basic documentation for the virtual



This patch documents XML elements used for support of virtual
crypto devices.

In the devices section in the domain XML users may specify:
  <crypto model='virtio'>
    <backend type='builtin' queues='1'/>
  </crypto>
to enable the crypto device for guests.

Signed-off-by: Longpeng(Mike) <longpeng2 huawei com>
---
 docs/formatdomain.html.in     | 61 +++++++++++++++++++++++++++++++++++++++++++
 docs/schemas/domaincommon.rng | 30 +++++++++++++++++++++
 2 files changed, 91 insertions(+)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 36bea67..7c27ae7 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7547,6 +7547,67 @@ qemu-kvm -net nic,model=? /dev/null
       </dd>
     </dl>
 
+    <h4><a name="elementCrypto">Crypto device</a></h4>
+
+    <p>
+      The virtual crypto device is a virtual crypto accelerator
+      card(provides crypto services, such as CIPHER, HMAC, HASH,
+      and AEAD) for virtual machines and it can be added to the
+      guest via the <code>crypto</code> element.
+      <span class="since">Since 3.6.0, QEMU and KVM only</span>
+    </p>
+
+    <p>
+      Example: usage of the crypto device:
+    </p>
+<pre>
+  ...
+  &lt;devices&gt;
+    &lt;crypto model='virtio'&gt;
+      &lt;backend type='builtin' queues='1'/&gt;
+    &lt;/crypto&gt;
+  &lt;/devices&gt;
+  ...
+</pre>
+    <dl>
+      <dt><code>model</code></dt>
+      <dd>
+        <p>
+          The required <code>model</code> attribute specifies what
+          type of crypto device is provide.
+          Currently only 'virtio' is supported and it needs virtio-crypto
+          guest driver.
+        </p>
+      </dd>
+      <dt><code>backend</code></dt>
+      <dd>
+        <p>
+          The <code>backend</code> element specifies the type and
+          number of queues of the crypto device to be used for the
+          domain.
+        </p>
+        <dl>
+          <dt><code>type</code></dt>
+          <dd>
+            <p>
+                The required <code>type</code> element specifies the
+                type of the crypto device.
+                Currently only supports 'builtin' which uses QEMU's
+                crypto APIs to complete the crypto operations.
+            </p>
+          </dd>
+          <dt><code>queues</code></dt>
+          <dd>
+            <p>
+                The optional <code>queues</code> element specifies the
+                number of queues of the crypto device, the default number
+                of queues is 1.
+            </p>
+          </dd>
+        </dl>
+      </dd>
+    </dl>
+
     <h3><a name="seclabel">Security label</a></h3>
 
     <p>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index bdf7103..6e3b0fd 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4506,6 +4506,7 @@
             <ref name="tpm"/>
             <ref name="shmem"/>
             <ref name="memorydev"/>
+            <ref name="crypto"/>
           </choice>
         </zeroOrMore>
         <optional>
@@ -5052,6 +5053,35 @@
     </optional>
   </define>
 
+  <define name="crypto">
+    <element name="crypto">
+      <attribute name="model">
+        <choice>
+          <value>virtio</value>
+        </choice>
+      </attribute>
+      <ref name="crypto-backend"/>
+      <optional>
+        <ref name="address"/>
+      </optional>
+    </element>
+  </define>
+
+  <define name="crypto-backend">
+    <element name="backend">
+      <attribute name="type">
+        <choice>
+          <value>builtin</value>
+        </choice>
+      </attribute>
+      <optional>
+        <attribute name="queues">
+          <ref name="positiveInteger"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+
   <define name="usbmaster">
     <element name="master">
       <attribute name="startport">
-- 
1.8.3.1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]