add network disk support

This patch adds network disk support to libvirt/QEMU.  The currently
supported protocols are nbd, rbd, and sheepdog.  The XML syntax is like
this:

    <disk type="network" device="disk">
      <driver name="qemu" type="raw" />
      <source protocol='rbd|sheepdog|nbd' name="...some image identifier...">
        <host name="mon1.example.org" port="6000">
        <host name="mon2.example.org" port="6000">
        <host name="mon3.example.org" port="6000">
      </source>
      <target dev="vda" bus="virtio" />
    </disk>

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
This commit is contained in:
MORITA Kazutaka
2010-12-06 16:24:09 +09:00
committed by Eric Blake
parent 85d5fb19b1
commit 036ad5052b
5 changed files with 359 additions and 9 deletions

View File

@@ -612,6 +612,37 @@
<ref name="diskspec"/>
</interleave>
</group>
<group>
<attribute name="type">
<value>network</value>
</attribute>
<interleave>
<optional>
<element name="source">
<attribute name="protocol">
<choice>
<value>nbd</value>
<value>rbd</value>
<value>sheepdog</value>
</choice>
</attribute>
<attribute name="name"/>
<zeroOrMore>
<element name="host">
<attribute name="name">
<ref name="genericName"/>
</attribute>
<attribute name="port">
<ref name="unsignedInt"/>
</attribute>
</element>
</zeroOrMore>
<empty/>
</element>
</optional>
<ref name="diskspec"/>
</interleave>
</group>
<ref name="diskspec"/>
</choice>
</element>