Use XMLBuilder for Storage object handling

Simplify the API a bunch while we are at it, add tests, etc.
This commit is contained in:
Cole Robinson
2013-09-19 20:18:12 -04:00
parent 3db5cb5f06
commit aff0ddb259
53 changed files with 892 additions and 1573 deletions

View File

@@ -0,0 +1,15 @@
<volume>
<name>pool-dir-vol</name>
<capacity>2000</capacity>
<allocation>1000</allocation>
<target>
<format type="qcow2"/>
<permissions>
<mode>0744</mode>
<owner>10000</owner>
<group>10000</group>
<label>foo.label</label>
</permissions>
<path>/foo/bar</path>
</target>
</volume>

View File

@@ -0,0 +1,15 @@
<pool type="dir">
<name>foo-new</name>
<uuid>10211510-2115-1021-1510-211510211999</uuid>
<capacity unit="bytes">200000</capacity>
<allocation unit="bytes">150000</allocation>
<available unit="bytes">50000</available>
<source>
<format type="ext3"/>
<device path="/dev/foo/bar"/>
<name>fooname</name>
</source>
<target>
<path>/mnt/my/foo</path>
</target>
</pool>

View File

@@ -0,0 +1,14 @@
<pool type="fs">
<name>pool-fs</name>
<uuid>10211510-2115-1021-1510-211510211510</uuid>
<capacity unit='bytes'>984373075968</capacity>
<allocation unit='bytes'>756681687040</allocation>
<available unit='bytes'>227691388928</available>
<source>
<format type="auto"/>
<device path="/some/source/path"/>
</source>
<target>
<path>/some/target/path</path>
</target>
</pool>

View File

@@ -0,0 +1,14 @@
<pool type="iscsi">
<name>pool-iscsi</name>
<uuid>10511599-1151-0510-5115-991151051051</uuid>
<source>
<host name="my.host"/>
<device path="/some/source/path"/>
<initiator>
<iqn name="my.iqn"/>
</initiator>
</source>
<target>
<path>/some/target/path</path>
</target>
</pool>