[libvirt] [PATCH 1/6] unpriv_sgio: Add docs and rng schema for new XML unpriv_sgio

Osier Yang jyang at redhat.com
Mon Nov 26 10:54:02 UTC 2012


Since "rawio" and "unpriv_sgio" are only valid for "lun", this
groups them together. And since both of them intend to allow
the unprivledged user to use the SCSI commands, they are must be
exclusive. Actually "unpriv_sgio" supersedes "rawio", as it
confines the capability per-device, unlike "rawio", which gives
the domain process broad capablity.
---
 docs/formatdomain.html.in     |   10 +++++++-
 docs/schemas/domaincommon.rng |   52 ++++++++++++++++++++++++++++------------
 2 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 6a3b976..f3f6a9e 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1395,7 +1395,15 @@
         rawio='yes', rawio capability will be enabled for all disks in
         the domain (because, in the case of QEMU, this capability can
         only be set on a per-process basis). This attribute is only
-        valid when device is "lun".
+        valid when device is "lun". NB, <code>rawio</code> gives
+        the domain process broad capability, to confined the capability
+        as much as possible, one should use <code>unpriv_sgio</code>
+        instead, which controls the capability per-device.
+        The optional <code>unpriv_sgio</code> attribute
+        (<span class="since">since 1.0.1</span>) indicates whether the
+        disk will allow unprivileged SG_IO, valid settings are "yes"
+        or "no" (defaults to "no"). Note that it's exclusive with
+        attribute <code>rawio</code>;
         The optional <code>snapshot</code> attribute indicates the default
         behavior of the disk during disk snapshots: "internal"
         requires a file format such as qcow2 that can store both the
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 02ad477..7da571c 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -957,24 +957,44 @@
     -->
   <define name="disk">
     <element name="disk">
-      <optional>
-        <attribute name="device">
-          <choice>
-            <value>floppy</value>
-            <value>disk</value>
-            <value>cdrom</value>
-            <value>lun</value>
-          </choice>
-        </attribute>
-      </optional>
-      <optional>
-        <attribute name="rawio">
+      <choice>
+        <group>
+          <optional>
+            <attribute name="device">
+              <choice>
+                <value>floppy</value>
+                <value>disk</value>
+                <value>cdrom</value>
+              </choice>
+            </attribute>
+          </optional>
+        </group>
+        <group>
+          <optional>
+            <attribute name="device">
+              <value>lun</value>
+            </attribute>
+          </optional>
           <choice>
-            <value>yes</value>
-            <value>no</value>
+            <optional>
+              <attribute name="rawio">
+                <choice>
+                  <value>yes</value>
+                  <value>no</value>
+                </choice>
+              </attribute>
+            </optional>
+            <optional>
+              <attribute name="unpriv_sgio">
+                <choice>
+                  <value>yes</value>
+                  <value>no</value>
+                </choice>
+              </attribute>
+            </optional>
           </choice>
-        </attribute>
-      </optional>
+        </group>
+      </choice>
       <optional>
         <ref name="snapshot"/>
       </optional>
-- 
1.7.7.6




More information about the libvir-list mailing list