[PATCH] Allow root directory in filesystem source dir schema

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

 



Use absDirPath instead of absFilePath.

https://bugzilla.redhat.com/show_bug.cgi?id=1028107
---
 docs/schemas/domaincommon.rng                  |  4 ++--
 tests/lxcxml2xmldata/lxc-filesystem-ram.xml    |  4 ++++
 tests/lxcxml2xmldata/lxc-filesystem-root.xml   | 25 +++++++++++++++++++++++++
 tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml |  4 ++++
 tests/lxcxml2xmltest.c                         |  1 +
 5 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 tests/lxcxml2xmldata/lxc-filesystem-root.xml

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 14b6700..1f30161 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1679,7 +1679,7 @@
           <interleave>
             <element name="source">
               <attribute name="dir">
-                <ref name="absFilePath"/>
+                <ref name="absDirPath"/>
               </attribute>
               <empty/>
             </element>
@@ -1697,7 +1697,7 @@
           <interleave>
             <element name="source">
               <attribute name="dir">
-                <ref name="absFilePath"/>
+                <ref name="absDirPath"/>
               </attribute>
               <empty/>
             </element>
diff --git a/tests/lxcxml2xmldata/lxc-filesystem-ram.xml b/tests/lxcxml2xmldata/lxc-filesystem-ram.xml
index 002fde6..58ae344 100644
--- a/tests/lxcxml2xmldata/lxc-filesystem-ram.xml
+++ b/tests/lxcxml2xmldata/lxc-filesystem-ram.xml
@@ -14,6 +14,10 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/libexec/libvirt_lxc</emulator>
+    <filesystem type='bind'>
+        <source dir='/'/>
+        <target dir='/'/>
+    </filesystem>
     <filesystem type='ram'>
         <source usage='1048576'/>
         <target dir='/mnt/mississippi'/>
diff --git a/tests/lxcxml2xmldata/lxc-filesystem-root.xml b/tests/lxcxml2xmldata/lxc-filesystem-root.xml
new file mode 100644
index 0000000..1ce2b32
--- /dev/null
+++ b/tests/lxcxml2xmldata/lxc-filesystem-root.xml
@@ -0,0 +1,25 @@
+<domain type='lxc'>
+  <name>demo</name>
+  <uuid>8369f1ac-7e46-e869-4ca5-759d51478066</uuid>
+  <memory unit='KiB'>500000</memory>
+  <currentMemory unit='KiB'>500000</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>exe</type>
+    <init>/bin/sh</init>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/libexec/libvirt_lxc</emulator>
+    <filesystem type='mount' accessmode='passthrough'>
+      <source dir='/'/>
+      <target dir='/'/>
+    </filesystem>
+    <console type='pty'>
+      <target type='lxc' port='0'/>
+    </console>
+  </devices>
+</domain>
diff --git a/tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml b/tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml
index d2369a2..93162b3 100644
--- a/tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml
+++ b/tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml
@@ -14,6 +14,10 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/libexec/libvirt_lxc</emulator>
+    <filesystem type='bind' accessmode='passthrough'>
+      <source dir='/'/>
+      <target dir='/'/>
+    </filesystem>
     <filesystem type='ram' accessmode='passthrough'>
       <source usage='1048576' units='KiB'/>
       <target dir='/mnt/mississippi'/>
diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c
index 1692e4b..a028e39 100644
--- a/tests/lxcxml2xmltest.c
+++ b/tests/lxcxml2xmltest.c
@@ -137,6 +137,7 @@ mymain(void)
     DO_TEST("hostdev");
     DO_TEST("disk-formats");
     DO_TEST_DIFFERENT("filesystem-ram");
+    DO_TEST("filesystem-root");
 
     virObjectUnref(caps);
     virObjectUnref(xmlopt);
-- 
1.8.1.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]