]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain: add support for iscsi network disks
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Feb 2013 17:44:26 +0000 (18:44 +0100)
committerEric Blake <eblake@redhat.com>
Wed, 20 Mar 2013 23:30:25 +0000 (17:30 -0600)
This plumbs in the XML description of iSCSI shares.  The next patches
will add support for the libiscsi userspace initiator.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c

index e83bdd0649abec20f62ed24b24167b965e265342..e4ed3f7f35d865360c43fafaebb1b1cf84b17db4 100644 (file)
         to the directory to use as the disk. If the disk <code>type</code>
         is "network", then the <code>protocol</code> attribute specifies
         the protocol to access to the requested image; possible values
-        are "nbd", "rbd", "sheepdog" or "gluster".  If the
+        are "nbd", "iscsi", "rbd", "sheepdog" or "gluster".  If the
         <code>protocol</code> attribute is "rbd", "sheepdog" or "gluster", an
         additional attribute <code>name</code> is mandatory to specify which
         volume/image will be used; for "nbd" it is optional.  When the disk
         or more <code>host</code> sub-elements used to specify the hosts
         to connect.
         <span class="since">Since 0.0.3; <code>type='dir'</code> since
-        0.7.5; <code>type='network'</code> since 0.8.7</span><br/>
+        0.7.5; <code>type='network'</code> since
+        0.8.7; <code>protocol='iscsi'</code> since 1.0.4</span><br/>
         For a "file" disk type which represents a cdrom or floppy
         (the <code>device</code> attribute), it is possible to define
         policy what to do with the disk if the source file is not accessible.
             <td> a server running nbd-server </td>
             <td> only one </td>
           </tr>
+          <tr>
+            <td> iscsi </td>
+            <td> an iSCSI server </td>
+            <td> only one </td>
+          </tr>
           <tr>
             <td> rbd </td>
             <td> monitor servers of RBD </td>
index 90647df7a658ce1be79d2a286964ee48aa8c49d8..c4e7b7abb0f29d5fa21654a902dd9148fb3a36d9 100644 (file)
                     <value>rbd</value>
                     <value>sheepdog</value>
                     <value>gluster</value>
+                    <value>iscsi</value>
                   </choice>
                 </attribute>
                 <optional>
index fa703291768ff3009da74cfa936defc3d0669582..b06cae5793a3473ae7c909091d7642d7b9a576e5 100644 (file)
@@ -250,7 +250,8 @@ VIR_ENUM_IMPL(virDomainDiskProtocol, VIR_DOMAIN_DISK_PROTOCOL_LAST,
               "nbd",
               "rbd",
               "sheepdog",
-              "gluster")
+              "gluster",
+              "iscsi")
 
 VIR_ENUM_IMPL(virDomainDiskProtocolTransport, VIR_DOMAIN_DISK_PROTO_TRANS_LAST,
               "tcp",
index 6d856a3934bcea6a58421cd4ff614e8a817d8764..a750a1f862e01016d7221c844a96adc9137fa737 100644 (file)
@@ -500,6 +500,7 @@ enum virDomainDiskProtocol {
     VIR_DOMAIN_DISK_PROTOCOL_RBD,
     VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG,
     VIR_DOMAIN_DISK_PROTOCOL_GLUSTER,
+    VIR_DOMAIN_DISK_PROTOCOL_ISCSI,
 
     VIR_DOMAIN_DISK_PROTOCOL_LAST
 };
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml
new file mode 100644 (file)
index 0000000..dd85032
--- /dev/null
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='iscsi' name='iqn.1992-01.com.example'>
+        <host name='example.org' port='6000'/>
+      </source>
+      <target dev='vda' bus='virtio'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
index 09d81e04e5e7b7fdc5bd16930837f5d33ea5a60a..41613ea95c1928c7b4a201fd8f217d07931281ea 100644 (file)
@@ -174,6 +174,7 @@ mymain(void)
     DO_TEST("disk-drive-network-nbd-ipv6");
     DO_TEST("disk-drive-network-nbd-ipv6-export");
     DO_TEST("disk-drive-network-nbd-unix");
+    DO_TEST("disk-drive-network-iscsi");
     DO_TEST("disk-scsi-device");
     DO_TEST("disk-scsi-vscsi");
     DO_TEST("disk-scsi-virtio-scsi");