]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Introduce iscsi_direct pool type
authorClementine Hayat <clem@lse.epita.fr>
Tue, 31 Jul 2018 08:44:21 +0000 (10:44 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 6 Aug 2018 10:23:55 +0000 (12:23 +0200)
Introducing the pool as a noop. Integration inside the build
system. Implementation will be in the following commits.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
19 files changed:
configure.ac
docs/schemas/storagepool.rng
docs/storage.html.in
m4/virt-storage-iscsi-direct.m4 [new file with mode: 0644]
src/conf/domain_conf.c
src/conf/storage_conf.c
src/conf/storage_conf.h
src/conf/virstorageobj.c
src/storage/Makefile.inc.am
src/storage/storage_backend.c
src/storage/storage_backend_iscsi_direct.c [new file with mode: 0644]
src/storage/storage_backend_iscsi_direct.h [new file with mode: 0644]
src/storage/storage_driver.c
tests/storagepoolxml2xmlin/pool-iscsi-direct-auth.xml [new file with mode: 0644]
tests/storagepoolxml2xmlin/pool-iscsi-direct.xml [new file with mode: 0644]
tests/storagepoolxml2xmlout/pool-iscsi-direct-auth.xml [new file with mode: 0644]
tests/storagepoolxml2xmlout/pool-iscsi-direct.xml [new file with mode: 0644]
tests/storagepoolxml2xmltest.c
tools/virsh-pool.c

index fae97d5487171c79cb000c9c6090bd8404b2c1d7..5e49b8483f6ed12973b3749876a558a4807070f6 100644 (file)
@@ -566,6 +566,7 @@ LIBVIRT_STORAGE_ARG_DIR
 LIBVIRT_STORAGE_ARG_FS
 LIBVIRT_STORAGE_ARG_LVM
 LIBVIRT_STORAGE_ARG_ISCSI
+LIBVIRT_STORAGE_ARG_ISCSI_DIRECT
 LIBVIRT_STORAGE_ARG_SCSI
 LIBVIRT_STORAGE_ARG_MPATH
 LIBVIRT_STORAGE_ARG_DISK
@@ -580,6 +581,7 @@ if test "$with_libvirtd" = "no"; then
   with_storage_fs=no
   with_storage_lvm=no
   with_storage_iscsi=no
+  with_storage_iscsi_direct=no
   with_storage_scsi=no
   with_storage_mpath=no
   with_storage_disk=no
@@ -600,6 +602,7 @@ LIBVIRT_STORAGE_CHECK_DIR
 LIBVIRT_STORAGE_CHECK_FS
 LIBVIRT_STORAGE_CHECK_LVM
 LIBVIRT_STORAGE_CHECK_ISCSI
+LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT
 LIBVIRT_STORAGE_CHECK_SCSI
 LIBVIRT_STORAGE_CHECK_MPATH
 LIBVIRT_STORAGE_CHECK_DISK
@@ -610,7 +613,7 @@ LIBVIRT_STORAGE_CHECK_ZFS
 LIBVIRT_STORAGE_CHECK_VSTORAGE
 
 with_storage=no
-for backend in dir fs lvm iscsi scsi mpath rbd disk; do
+for backend in dir fs lvm iscsi iscsi_direct scsi mpath rbd disk; do
     if eval test \$with_storage_$backend = yes; then
         with_storage=yes
         break
@@ -938,6 +941,7 @@ LIBVIRT_STORAGE_RESULT_DIR
 LIBVIRT_STORAGE_RESULT_FS
 LIBVIRT_STORAGE_RESULT_LVM
 LIBVIRT_STORAGE_RESULT_ISCSI
+LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT
 LIBVIRT_STORAGE_RESULT_SCSI
 LIBVIRT_STORAGE_RESULT_MPATH
 LIBVIRT_STORAGE_RESULT_DISK
index 52b2044bef0fa0ee001cd7b63298e4e2ad8d1530..11ac55d06fcf0467c94e0cd0642db3b0f911b532 100644 (file)
@@ -18,6 +18,7 @@
         <ref name='poollogical'/>
         <ref name='pooldisk'/>
         <ref name='pooliscsi'/>
+        <ref name='pooliscsidirect'/>
         <ref name='poolscsi'/>
         <ref name='poolmpath'/>
         <ref name='poolrbd'/>
     </interleave>
   </define>
 
+  <define name='pooliscsidirect'>
+    <attribute name='type'>
+      <value>iscsi-direct</value>
+    </attribute>
+    <interleave>
+      <ref name='commonmetadata'/>
+      <optional>
+        <ref name='sizing'/>
+      </optional>
+      <ref name='sourceiscsidirect'/>
+    </interleave>
+  </define>
+
   <define name='poolscsi'>
     <attribute name='type'>
       <value>scsi</value>
     </element>
   </define>
 
+  <define name='sourceinfodeviscsidirect'>
+    <element name='device'>
+      <attribute name='path'>
+        <ref name='IscsiQualifiedName'/>
+      </attribute>
+    </element>
+  </define>
+
   <define name='initiatorinfo'>
     <element name='initiator'>
       <element name='iqn'>
     </element>
   </define>
 
+  <define name='sourceiscsidirect'>
+    <element name='source'>
+      <interleave>
+        <ref name='sourceinfohost'/>
+        <ref name='sourceinfodeviscsidirect'/>
+        <ref name='initiatorinfo'/>
+        <optional>
+          <ref name='sourceinfoauth'/>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
   <define name='sourcescsi'>
     <element name='source'>
       <interleave>
index 1906aa6cd44493ef2188551e36a588680960da6a..744819d99db1e3e9994806fb6639dee8624bcbf4 100644 (file)
       The iSCSI volume pool does not use the volume format type element.
     </p>
 
+    <h2><a id="StorageBackendISCSIDirect">iSCSI direct pool</a></h2>
+    <p>
+      This is a variant of the iSCSI pool. Instead of unsing iscsiadm, it uses
+      libiscsi.
+      It require a host, a path which is the target iqn and an initiator iqn.
+    </p>
+
+    <h3>Example pool input</h3>
+    <pre>
+&lt;pool type="iscsi-direct"&gt;
+  &lt;name&gt;virtimages&lt;/name&gt;
+  &lt;source&gt;
+    &lt;host name="iscsi.example.com"/&gt;
+    &lt;device path="iqn.2013-06.com.example:iscsi-pool"/&gt;
+  &lt;/source&gt;
+  &lt;initiator&gt;
+    &lt;iqn name="iqn.2013-06.com.example:iscsi-initiator"/&gt;
+  &lt;/initiator&gt;
+&lt;/pool&gt;</pre>
+
+    <h3>Valid pool format types</h3>
+    <p>
+      The iSCSI volume pool does not use the pool format type element.
+    </p>
+
+    <h3>Valid volume format types</h3>
+    <p>
+      The iSCSI volume pool does not use the volume format type element.
+    </p>
+
     <h2><a id="StorageBackendSCSI">SCSI pool</a></h2>
     <p>
       This provides a pool based on a SCSI HBA. Volumes are preexisting SCSI
diff --git a/m4/virt-storage-iscsi-direct.m4 b/m4/virt-storage-iscsi-direct.m4
new file mode 100644 (file)
index 0000000..cc2d490
--- /dev/null
@@ -0,0 +1,41 @@
+dnl Iscsi-direct storage
+dnl
+dnl Copyright (C) 2018 Clementine Hayat.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library.  If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([LIBVIRT_STORAGE_ARG_ISCSI_DIRECT], [
+  LIBVIRT_ARG_WITH_FEATURE([STORAGE_ISCSI_DIRECT],
+                           [iscsi-direct backend for the storage driver],
+                           [check])
+])
+
+AC_DEFUN([LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT], [
+  AC_REQUIRE([LIBVIRT_CHECK_LIBISCSI])
+  if test "$with_storage_iscsi_direct" = "check"; then
+    with_storage_iscsi_direct=$with_libiscsi
+  fi
+  if test "$with_storage_iscsi_direct" = "yes"; then
+    AC_DEFINE_UNQUOTED([WITH_STORAGE_ISCSI_DIRECT], [1],
+                       [whether iSCSI backend for storage driver is enabled])
+  fi
+  AM_CONDITIONAL([WITH_STORAGE_ISCSI_DIRECT],
+                 [test "$with_storage_iscsi_direct" = "yes"])
+])
+
+AC_DEFUN([LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT], [
+  LIBVIRT_RESULT([iscsi-direct], [$with_storage_iscsi_direct])
+])
index eff8af20e7073eb3222db5bb5cf6e1cb6998d31c..7dcbe8a20bccc2361b46e4a2019f97086f17b838 100644 (file)
@@ -30252,6 +30252,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
 
         break;
 
+    case VIR_STORAGE_POOL_ISCSI_DIRECT:
     case VIR_STORAGE_POOL_ISCSI:
         if (def->startupPolicy) {
             virReportError(VIR_ERR_XML_ERROR, "%s",
index 5036ab9ef8a02241642ac180336114e6609a067d..a0c92af820d25e920800bd35a3703c8c3f2d160a 100644 (file)
@@ -62,9 +62,9 @@ VIR_ENUM_IMPL(virStoragePool,
               VIR_STORAGE_POOL_LAST,
               "dir", "fs", "netfs",
               "logical", "disk", "iscsi",
-              "scsi", "mpath", "rbd",
-              "sheepdog", "gluster", "zfs",
-              "vstorage")
+              "iscsi-direct", "scsi", "mpath",
+              "rbd", "sheepdog", "gluster",
+              "zfs", "vstorage")
 
 VIR_ENUM_IMPL(virStoragePoolFormatFileSystem,
               VIR_STORAGE_POOL_FS_LAST,
@@ -207,6 +207,17 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
          .formatToString = virStoragePoolFormatDiskTypeToString,
       }
     },
+    {.poolType = VIR_STORAGE_POOL_ISCSI_DIRECT,
+     .poolOptions = {
+         .flags = (VIR_STORAGE_POOL_SOURCE_HOST |
+                   VIR_STORAGE_POOL_SOURCE_DEVICE |
+                   VIR_STORAGE_POOL_SOURCE_NETWORK |
+                   VIR_STORAGE_POOL_SOURCE_INITIATOR_IQN),
+      },
+      .volOptions = {
+         .formatToString = virStoragePoolFormatDiskTypeToString,
+      }
+    },
     {.poolType = VIR_STORAGE_POOL_SCSI,
      .poolOptions = {
          .flags = (VIR_STORAGE_POOL_SOURCE_ADAPTER),
@@ -803,6 +814,13 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
             goto error;
     }
 
+    if (ret->type == VIR_STORAGE_POOL_ISCSI_DIRECT &&
+        !ret->source.initiator.iqn) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("missing initiator IQN"));
+        goto error;
+    }
+
  cleanup:
     VIR_FREE(uuid);
     VIR_FREE(type);
@@ -1000,11 +1018,12 @@ virStoragePoolDefFormatBuf(virBufferPtr buf,
     if (virStoragePoolSourceFormat(buf, options, &def->source) < 0)
         return -1;
 
-    /* RBD, Sheepdog, and Gluster devices are not local block devs nor
+    /* RBD, Sheepdog, Gluster and Iscsi-direct devices are not local block devs nor
      * files, so they don't have a target */
     if (def->type != VIR_STORAGE_POOL_RBD &&
         def->type != VIR_STORAGE_POOL_SHEEPDOG &&
-        def->type != VIR_STORAGE_POOL_GLUSTER) {
+        def->type != VIR_STORAGE_POOL_GLUSTER &&
+        def->type != VIR_STORAGE_POOL_ISCSI_DIRECT) {
         virBufferAddLit(buf, "<target>\n");
         virBufferAdjustIndent(buf, 2);
 
index 15dfd8becf91ecafb080adf048b45a60de385e87..858623783ddd47f519f2035f757fc40a59be3cec 100644 (file)
@@ -85,6 +85,7 @@ typedef enum {
     VIR_STORAGE_POOL_LOGICAL,  /* Logical volume groups / volumes */
     VIR_STORAGE_POOL_DISK,     /* Disk partitions */
     VIR_STORAGE_POOL_ISCSI,    /* iSCSI targets */
+    VIR_STORAGE_POOL_ISCSI_DIRECT, /* iSCSI targets using libiscsi */
     VIR_STORAGE_POOL_SCSI,     /* SCSI HBA */
     VIR_STORAGE_POOL_MPATH,    /* Multipath devices */
     VIR_STORAGE_POOL_RBD,      /* RADOS Block Device */
index e66b2ebfb2235bed1822ac8c40609e477328ed6f..1c45bb71b92e743fa96fea83720b97cefbadda8f 100644 (file)
@@ -1838,11 +1838,13 @@ virStoragePoolObjSourceFindDuplicateCb(const void *payload,
         break;
 
     case VIR_STORAGE_POOL_ISCSI:
+    case VIR_STORAGE_POOL_ISCSI_DIRECT:
     case VIR_STORAGE_POOL_FS:
     case VIR_STORAGE_POOL_LOGICAL:
     case VIR_STORAGE_POOL_DISK:
     case VIR_STORAGE_POOL_ZFS:
         if ((data->def->type == VIR_STORAGE_POOL_ISCSI ||
+             data->def->type == VIR_STORAGE_POOL_ISCSI_DIRECT ||
              data->def->type == VIR_STORAGE_POOL_FS ||
              data->def->type == VIR_STORAGE_POOL_LOGICAL ||
              data->def->type == VIR_STORAGE_POOL_DISK ||
index ea98c0ee52e06282b87a39a29d445805d674a756..b2714fd96042c0bb8020f4e081112f783ccf64f8 100644 (file)
@@ -31,6 +31,11 @@ STORAGE_DRIVER_ISCSI_SOURCES = \
        storage/storage_backend_iscsi.c \
        $(NULL)
 
+STORAGE_DRIVER_ISCSI_DIRECT_SOURCES = \
+       storage/storage_backend_iscsi_direct.h \
+       storage/storage_backend_iscsi_direct.c \
+       $(NULL)
+
 STORAGE_DRIVER_SCSI_SOURCES = \
        storage/storage_backend_scsi.h \
        storage/storage_backend_scsi.c \
@@ -89,6 +94,7 @@ EXTRA_DIST += \
        $(STORAGE_FILE_FS_SOURCES) \
        $(STORAGE_DRIVER_LVM_SOURCES) \
        $(STORAGE_DRIVER_ISCSI_SOURCES) \
+       $(STORAGE_DRIVER_ISCSI_DIRECT_SOURCES) \
        $(STORAGE_DRIVER_SCSI_SOURCES) \
        $(STORAGE_DRIVER_MPATH_SOURCES) \
        $(STORAGE_DRIVER_DISK_SOURCES) \
@@ -193,6 +199,22 @@ libvirt_storage_backend_iscsi_la_LIBADD = \
        $(NULL)
 endif WITH_STORAGE_ISCSI
 
+if WITH_STORAGE_ISCSI_DIRECT
+libvirt_storage_backend_iscsi_direct_la_SOURCES = $(STORAGE_DRIVER_ISCSI_DIRECT_SOURCES)
+libvirt_storage_backend_iscsi_direct_la_CFLAGS = \
+       -I$(srcdir)/conf \
+       $(LIBISCSI_CFLAGS) \
+       $(AM_CFLAGS) \
+       $(NULL)
+
+storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi-direct.la
+libvirt_storage_backend_iscsi_direct_la_LDFLAGS = $(AM_LDFLAGS_MOD)
+libvirt_storage_backend_iscsi_direct_la_LIBADD = \
+       libvirt.la \
+       ../gnulib/lib/libgnu.la \
+       $(NULL)
+endif WITH_STORAGE_ISCSI_DIRECT
+
 if WITH_STORAGE_SCSI
 libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
 libvirt_storage_backend_scsi_la_CFLAGS = \
index 7d226f3d3aab5b74bd0a48c898f3cf9c17ca08dc..e7fbc37eb1041b9b2804894d8a85c6cd81c57110 100644 (file)
@@ -43,6 +43,9 @@
 #if WITH_STORAGE_ISCSI
 # include "storage_backend_iscsi.h"
 #endif
+#if WITH_STORAGE_ISCSI_DIRECT
+# include "storage_backend_iscsi_direct.h"
+#endif
 #if WITH_STORAGE_SCSI
 # include "storage_backend_scsi.h"
 #endif
@@ -122,6 +125,9 @@ virStorageBackendDriversRegister(bool allbackends ATTRIBUTE_UNUSED)
 #if WITH_STORAGE_ISCSI
     VIR_STORAGE_BACKEND_REGISTER(virStorageBackendISCSIRegister, "iscsi");
 #endif
+#if WITH_STORAGE_ISCSI_DIRECT
+    VIR_STORAGE_BACKEND_REGISTER(virStorageBackendISCSIDirectRegister, "iscsi-direct");
+#endif
 #if WITH_STORAGE_SCSI
     VIR_STORAGE_BACKEND_REGISTER(virStorageBackendSCSIRegister, "scsi");
 #endif
diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/storage_backend_iscsi_direct.c
new file mode 100644 (file)
index 0000000..94c4c98
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * storage_backend_iscsi_direct.c: storage backend for iSCSI using libiscsi
+ *
+ * Copyright (C) 2018 Clementine Hayat.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Author: Clementine Hayat <clem@lse.epita.fr>
+ */
+
+#include <config.h>
+
+#include "storage_backend_iscsi_direct.h"
+#include "storage_util.h"
+#include "virlog.h"
+
+#define VIR_FROM_THIS VIR_FROM_STORAGE
+
+VIR_LOG_INIT("storage.storage_backend_iscsi_direct");
+
+
+static int
+virStorageBackendISCSIDirectCheckPool(virStoragePoolObjPtr pool ATTRIBUTE_UNUSED,
+                                      bool *isActive ATTRIBUTE_UNUSED)
+{
+    return 0;
+}
+
+static int
+virStorageBackendISCSIDirectRefreshPool(virStoragePoolObjPtr pool ATTRIBUTE_UNUSED)
+{
+    return 0;
+}
+
+virStorageBackend virStorageBackendISCSIDirect = {
+    .type = VIR_STORAGE_POOL_ISCSI_DIRECT,
+
+    .checkPool = virStorageBackendISCSIDirectCheckPool,
+    .refreshPool = virStorageBackendISCSIDirectRefreshPool,
+};
+
+int
+virStorageBackendISCSIDirectRegister(void)
+{
+    return virStorageBackendRegister(&virStorageBackendISCSIDirect);
+}
diff --git a/src/storage/storage_backend_iscsi_direct.h b/src/storage/storage_backend_iscsi_direct.h
new file mode 100644 (file)
index 0000000..545579d
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __VIR_STORAGE_BACKEND_ISCSI_H__
+# define __VIR_STORAGE_BACKEND_ISCSI_H__
+
+int virStorageBackendISCSIDirectRegister(void);
+
+#endif /* __VIR_STORAGE_BACKEND_ISCSI_H__ */
index 8070d159ea04703ab675d78517b0ad91c366bfb7..c108f026ce37d29f7ae2fe89f2b2e38d75a58ec0 100644 (file)
@@ -1566,6 +1566,7 @@ storageVolLookupByPathCallback(virStoragePoolObjPtr obj,
         case VIR_STORAGE_POOL_LOGICAL:
         case VIR_STORAGE_POOL_DISK:
         case VIR_STORAGE_POOL_ISCSI:
+        case VIR_STORAGE_POOL_ISCSI_DIRECT:
         case VIR_STORAGE_POOL_SCSI:
         case VIR_STORAGE_POOL_MPATH:
         case VIR_STORAGE_POOL_VSTORAGE:
diff --git a/tests/storagepoolxml2xmlin/pool-iscsi-direct-auth.xml b/tests/storagepoolxml2xmlin/pool-iscsi-direct-auth.xml
new file mode 100644 (file)
index 0000000..96c82e1
--- /dev/null
@@ -0,0 +1,14 @@
+<pool type="iscsi-direct">
+  <name>iscsi-direct-auth</name>
+  <uuid>034d66fc-f507-437a-b552-c479ffd63820</uuid>
+  <source>
+    <host name="iscsi.example.com"/>
+    <device path="iqn.2013-06.com.example:iscsi-pool"/>
+    <initiator>
+      <iqn name='iqn.2013-06.com.example:iscsi-initiator'/>
+    </initiator>
+    <auth type='chap' username='user'>
+      <secret uuid='10ed4ad4-c7b0-4696-b574-b40e04fea84b'/>
+    </auth>
+  </source>
+</pool>
diff --git a/tests/storagepoolxml2xmlin/pool-iscsi-direct.xml b/tests/storagepoolxml2xmlin/pool-iscsi-direct.xml
new file mode 100644 (file)
index 0000000..9369a3c
--- /dev/null
@@ -0,0 +1,11 @@
+<pool type="iscsi-direct">
+  <name>iscsi-direct</name>
+  <uuid>034d66fc-f507-437a-b552-c479ffd63819</uuid>
+  <source>
+    <host name="iscsi.example.com"/>
+    <device path="iqn.2013-06.com.example:iscsi-pool"/>
+    <initiator>
+      <iqn name='iqn.2013-06.com.example:iscsi-initiator'/>
+    </initiator>
+  </source>
+</pool>
diff --git a/tests/storagepoolxml2xmlout/pool-iscsi-direct-auth.xml b/tests/storagepoolxml2xmlout/pool-iscsi-direct-auth.xml
new file mode 100644 (file)
index 0000000..63b9105
--- /dev/null
@@ -0,0 +1,17 @@
+<pool type='iscsi-direct'>
+  <name>iscsi-direct-auth</name>
+  <uuid>034d66fc-f507-437a-b552-c479ffd63820</uuid>
+  <capacity unit='bytes'>0</capacity>
+  <allocation unit='bytes'>0</allocation>
+  <available unit='bytes'>0</available>
+  <source>
+    <host name='iscsi.example.com'/>
+    <device path='iqn.2013-06.com.example:iscsi-pool'/>
+    <initiator>
+      <iqn name='iqn.2013-06.com.example:iscsi-initiator'/>
+    </initiator>
+    <auth type='chap' username='user'>
+      <secret uuid='10ed4ad4-c7b0-4696-b574-b40e04fea84b'/>
+    </auth>
+  </source>
+</pool>
diff --git a/tests/storagepoolxml2xmlout/pool-iscsi-direct.xml b/tests/storagepoolxml2xmlout/pool-iscsi-direct.xml
new file mode 100644 (file)
index 0000000..84717dd
--- /dev/null
@@ -0,0 +1,14 @@
+<pool type='iscsi-direct'>
+  <name>iscsi-direct</name>
+  <uuid>034d66fc-f507-437a-b552-c479ffd63819</uuid>
+  <capacity unit='bytes'>0</capacity>
+  <allocation unit='bytes'>0</allocation>
+  <available unit='bytes'>0</available>
+  <source>
+    <host name='iscsi.example.com'/>
+    <device path='iqn.2013-06.com.example:iscsi-pool'/>
+    <initiator>
+      <iqn name='iqn.2013-06.com.example:iscsi-initiator'/>
+    </initiator>
+  </source>
+</pool>
index 974f0afe39398b1219b3257c66a411944a527f3d..28421235bfb17585941655b4525d3510de03adc4 100644 (file)
@@ -102,6 +102,8 @@ mymain(void)
     DO_TEST("pool-zfs-sourcedev");
     DO_TEST("pool-rbd");
     DO_TEST("pool-vstorage");
+    DO_TEST("pool-iscsi-direct-auth");
+    DO_TEST("pool-iscsi-direct");
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
index 6faff781b2c6a72da8dfb48154658fe1cb484088..89206a48f5d9bf6edb8f4ce6a0fb3e021cf8c5fa 100644 (file)
@@ -1203,6 +1203,9 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
             case VIR_STORAGE_POOL_ISCSI:
                 flags |= VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI;
                 break;
+            case VIR_STORAGE_POOL_ISCSI_DIRECT:
+                flags |= VIR_CONNECT_LIST_STORAGE_POOLS_ISCSI;
+                break;
             case VIR_STORAGE_POOL_SCSI:
                 flags |= VIR_CONNECT_LIST_STORAGE_POOLS_SCSI;
                 break;