[libvirt] [PATCH] schema: Allow iSCSI source to have interleaved children

Michal Privoznik posted 1 patch 2 weeks ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/8ae23e795b4fca1e957d5723877bd4020028ba71.1578501077.git.mprivozn@redhat.com
docs/schemas/domaincommon.rng                 | 24 ++++++++++---------
.../disk-network-iscsi-modern.args            |  9 ++++++-
.../disk-network-iscsi-modern.xml             | 13 ++++++++++
3 files changed, 34 insertions(+), 12 deletions(-)

[libvirt] [PATCH] schema: Allow iSCSI source to have interleaved children

Posted by Michal Privoznik 2 weeks ago
There is no need to require users to produce iSCSI disk source
following our ordering of children elements. In fact, we don't
even accept our own order in the schema :(.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 docs/schemas/domaincommon.rng                 | 24 ++++++++++---------
 .../disk-network-iscsi-modern.args            |  9 ++++++-
 .../disk-network-iscsi-modern.xml             | 13 ++++++++++
 3 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 9b555d6acb..76d94b156f 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1772,17 +1772,19 @@
         <value>iscsi</value>
       </attribute>
       <attribute name="name"/>
-      <ref name="diskSourceCommon"/>
-      <ref name="diskSourceNetworkHost"/>
-      <optional>
-        <ref name="diskAuth"/>
-      </optional>
-      <optional>
-        <ref name="encryption"/>
-      </optional>
-      <optional>
-        <ref name="initiatorinfo"/>
-      </optional>
+      <interleave>
+        <ref name="diskSourceCommon"/>
+        <ref name="diskSourceNetworkHost"/>
+        <optional>
+          <ref name="diskAuth"/>
+        </optional>
+        <optional>
+          <ref name="encryption"/>
+        </optional>
+        <optional>
+          <ref name="initiatorinfo"/>
+        </optional>
+      </interleave>
     </element>
   </define>
 
diff --git a/tests/qemuxml2argvdata/disk-network-iscsi-modern.args b/tests/qemuxml2argvdata/disk-network-iscsi-modern.args
index 762dc0e04a..57eaeb40ee 100644
--- a/tests/qemuxml2argvdata/disk-network-iscsi-modern.args
+++ b/tests/qemuxml2argvdata/disk-network-iscsi-modern.args
@@ -58,4 +58,11 @@ file.target=iqn.1992-01.com.example:server,file.lun=0,file.transport=tcp,\
 file.initiator-name=iqn.1992-01.com.example:client,format=raw,if=none,\
 id=drive-scsi0-0-0-1 \
 -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=1,\
-drive=drive-scsi0-0-0-1,id=scsi0-0-0-1
+drive=drive-scsi0-0-0-1,id=scsi0-0-0-1 \
+-drive file.driver=iscsi,file.portal=example.org:3260,\
+file.target=iqn.1992-01.com.example:server,file.lun=0,file.transport=tcp,\
+file.user=myname,file.password-secret=AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A,\
+file.initiator-name=iqn.1992-01.com.example:client,format=raw,if=none,\
+id=drive-scsi0-0-0-2 \
+-device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=2,\
+drive=drive-scsi0-0-0-2,id=scsi0-0-0-2
diff --git a/tests/qemuxml2argvdata/disk-network-iscsi-modern.xml b/tests/qemuxml2argvdata/disk-network-iscsi-modern.xml
index 759d5e217f..07bb457bfa 100644
--- a/tests/qemuxml2argvdata/disk-network-iscsi-modern.xml
+++ b/tests/qemuxml2argvdata/disk-network-iscsi-modern.xml
@@ -65,6 +65,19 @@
       </source>
       <target dev='sdb' bus='scsi'/>
     </disk>
+    <disk type='network' device='lun'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='iscsi' name='iqn.1992-01.com.example:server/0'>
+        <host name='example.org' port='3260'/>
+        <initiator>
+          <iqn name='iqn.1992-01.com.example:client'/>
+        </initiator>
+        <auth username='myname'>
+          <secret type='iscsi' usage='mycluster_myname'/>
+        </auth>
+      </source>
+      <target dev='sdc' bus='scsi'/>
+    </disk>
     <controller type='usb' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
     <controller type='scsi' index='0' model='virtio-scsi'/>
-- 
2.24.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] schema: Allow iSCSI source to have interleaved children

Posted by Laine Stump 2 weeks ago
On 1/8/20 11:31 AM, Michal Privoznik wrote:
> There is no need to require users to produce iSCSI disk source
> following our ordering of children elements. In fact, we don't
> even accept our own order in the schema :(.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>


Reviewed-by: Laine Stump <laine@redhat.com>


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list