render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
43fe83
From 88c5f4f82ea78857962ff3bd601aaa25dcb7d8bf Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <88c5f4f82ea78857962ff3bd601aaa25dcb7d8bf.1383922565.git.jdenemar@redhat.com>
43fe83
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
43fe83
Date: Thu, 7 Nov 2013 18:55:21 +0100
43fe83
Subject: [PATCH] Allow root directory in filesystem source dir schema
43fe83
43fe83
Use absDirPath instead of absFilePath.
43fe83
43fe83
https://bugzilla.redhat.com/show_bug.cgi?id=1028107
43fe83
(cherry picked from commit eab51940bd9d3b5f8b73f52c50ba6d00648f0909)
43fe83
43fe83
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
43fe83
---
43fe83
 docs/schemas/domaincommon.rng                  |  4 ++--
43fe83
 tests/lxcxml2xmldata/lxc-filesystem-ram.xml    |  4 ++++
43fe83
 tests/lxcxml2xmldata/lxc-filesystem-root.xml   | 25 +++++++++++++++++++++++++
43fe83
 tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml |  4 ++++
43fe83
 tests/lxcxml2xmltest.c                         |  1 +
43fe83
 5 files changed, 36 insertions(+), 2 deletions(-)
43fe83
 create mode 100644 tests/lxcxml2xmldata/lxc-filesystem-root.xml
43fe83
43fe83
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
43fe83
index 5540745..c7eaf00 100644
43fe83
--- a/docs/schemas/domaincommon.rng
43fe83
+++ b/docs/schemas/domaincommon.rng
43fe83
@@ -1628,7 +1628,7 @@
43fe83
           <interleave>
43fe83
             <element name="source">
43fe83
               <attribute name="dir">
43fe83
-                <ref name="absFilePath"/>
43fe83
+                <ref name="absDirPath"/>
43fe83
               </attribute>
43fe83
               <empty/>
43fe83
             </element>
43fe83
@@ -1646,7 +1646,7 @@
43fe83
           <interleave>
43fe83
             <element name="source">
43fe83
               <attribute name="dir">
43fe83
-                <ref name="absFilePath"/>
43fe83
+                <ref name="absDirPath"/>
43fe83
               </attribute>
43fe83
               <empty/>
43fe83
             </element>
43fe83
diff --git a/tests/lxcxml2xmldata/lxc-filesystem-ram.xml b/tests/lxcxml2xmldata/lxc-filesystem-ram.xml
43fe83
index 002fde6..58ae344 100644
43fe83
--- a/tests/lxcxml2xmldata/lxc-filesystem-ram.xml
43fe83
+++ b/tests/lxcxml2xmldata/lxc-filesystem-ram.xml
43fe83
@@ -14,6 +14,10 @@
43fe83
   <on_crash>destroy</on_crash>
43fe83
   <devices>
43fe83
     <emulator>/usr/libexec/libvirt_lxc</emulator>
43fe83
+    <filesystem type='bind'>
43fe83
+        <source dir='/'/>
43fe83
+        <target dir='/'/>
43fe83
+    </filesystem>
43fe83
     <filesystem type='ram'>
43fe83
         <source usage='1048576'/>
43fe83
         <target dir='/mnt/mississippi'/>
43fe83
diff --git a/tests/lxcxml2xmldata/lxc-filesystem-root.xml b/tests/lxcxml2xmldata/lxc-filesystem-root.xml
43fe83
new file mode 100644
43fe83
index 0000000..1ce2b32
43fe83
--- /dev/null
43fe83
+++ b/tests/lxcxml2xmldata/lxc-filesystem-root.xml
43fe83
@@ -0,0 +1,25 @@
43fe83
+<domain type='lxc'>
43fe83
+  <name>demo</name>
43fe83
+  <uuid>8369f1ac-7e46-e869-4ca5-759d51478066</uuid>
43fe83
+  <memory unit='KiB'>500000</memory>
43fe83
+  <currentMemory unit='KiB'>500000</currentMemory>
43fe83
+  <vcpu placement='static'>1</vcpu>
43fe83
+  <os>
43fe83
+    <type arch='x86_64'>exe</type>
43fe83
+    <init>/bin/sh</init>
43fe83
+  </os>
43fe83
+  <clock offset='utc'/>
43fe83
+  <on_poweroff>destroy</on_poweroff>
43fe83
+  <on_reboot>restart</on_reboot>
43fe83
+  <on_crash>destroy</on_crash>
43fe83
+  <devices>
43fe83
+    <emulator>/usr/libexec/libvirt_lxc</emulator>
43fe83
+    <filesystem type='mount' accessmode='passthrough'>
43fe83
+      <source dir='/'/>
43fe83
+      <target dir='/'/>
43fe83
+    </filesystem>
43fe83
+    <console type='pty'>
43fe83
+      <target type='lxc' port='0'/>
43fe83
+    </console>
43fe83
+  </devices>
43fe83
+</domain>
43fe83
diff --git a/tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml b/tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml
43fe83
index d2369a2..93162b3 100644
43fe83
--- a/tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml
43fe83
+++ b/tests/lxcxml2xmloutdata/lxc-filesystem-ram.xml
43fe83
@@ -14,6 +14,10 @@
43fe83
   <on_crash>destroy</on_crash>
43fe83
   <devices>
43fe83
     <emulator>/usr/libexec/libvirt_lxc</emulator>
43fe83
+    <filesystem type='bind' accessmode='passthrough'>
43fe83
+      <source dir='/'/>
43fe83
+      <target dir='/'/>
43fe83
+    </filesystem>
43fe83
     <filesystem type='ram' accessmode='passthrough'>
43fe83
       <source usage='1048576' units='KiB'/>
43fe83
       <target dir='/mnt/mississippi'/>
43fe83
diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c
43fe83
index f8b5959..8f66f82 100644
43fe83
--- a/tests/lxcxml2xmltest.c
43fe83
+++ b/tests/lxcxml2xmltest.c
43fe83
@@ -132,6 +132,7 @@ mymain(void)
43fe83
     DO_TEST("hostdev");
43fe83
     DO_TEST("disk-formats");
43fe83
     DO_TEST_DIFFERENT("filesystem-ram");
43fe83
+    DO_TEST("filesystem-root");
43fe83
 
43fe83
     virObjectUnref(caps);
43fe83
     virObjectUnref(xmlopt);
43fe83
-- 
43fe83
1.8.4.2
43fe83