[virt-tools-list] [virt-manager PATCH] cli: Add --disk wwn

Athina.Pl athina.plaskasoviti at gmail.com
Fri May 17 15:26:02 UTC 2019


XML mapping:

<disk>
  <wwn>...</wwn>
</disk>

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti at gmail.com>
---
 tests/cli-test-xml/compare/virt-install-many-devices.xml | 1 +
 tests/clitest.py                                         | 2 +-
 tests/xmlparse-xml/change-disk-out.xml                   | 1 +
 tests/xmlparse.py                                        | 1 +
 virtinst/cli.py                                          | 1 +
 virtinst/devices/disk.py                                 | 1 +
 6 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index 46f1f34f..4dd4efe6 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -42,6 +42,7 @@
       <source file="/dev/default-pool/UPPER"/>
       <target dev="vda" bus="virtio"/>
       <serial>WD-WMAP9A966149</serial>
+      <wwn>123456789abcdefa</wwn>
       <shareable/>
       <boot order="2"/>
     </disk>
diff --git a/tests/clitest.py b/tests/clitest.py
index 775d72fb..fcaae358 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -516,7 +516,7 @@ vcpus.vcpu.id=3,vcpus.vcpu0.enabled=yes,vcpus.vcpu0.order=3,\
 vcpus.vcpu1.id=2,vcpus.vcpu1.enabled=yes
 --cpu none
 
---disk /dev/default-pool/UPPER,cache=writeback,io=threads,perms=sh,serial=WD-WMAP9A966149,boot_order=2
+--disk /dev/default-pool/UPPER,cache=writeback,io=threads,perms=sh,serial=WD-WMAP9A966149,wwn=123456789abcdefa,boot_order=2
 --disk %(NEWIMG1)s,sparse=false,size=.001,perms=ro,error_policy=enospace,discard=unmap,detect_zeroes=unmap,address.type=drive,address.controller=0,address.target=2,address.unit=0
 --disk device=cdrom,bus=sata,read_bytes_sec=1,read_iops_sec=2,write_bytes_sec=5,write_iops_sec=6,driver.copy_on_read=on,geometry.cyls=16383,geometry.heads=16,geometry.secs=63,geometry.trans=lba
 --disk size=1
diff --git a/tests/xmlparse-xml/change-disk-out.xml b/tests/xmlparse-xml/change-disk-out.xml
index 1fa26591..66416306 100644
--- a/tests/xmlparse-xml/change-disk-out.xml
+++ b/tests/xmlparse-xml/change-disk-out.xml
@@ -23,6 +23,7 @@
       <target dev="hda" bus="usb" removable="on"/>
       <serial>frob</serial>
       <driver name="test" type="raw"/>
+      <wwn>123456789abcdefa</wwn>
     </disk>
     <disk type="block" device="disk">
       <source dev="/dev/null">
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 2e373bf9..1d614ccc 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -377,6 +377,7 @@ class XMLParseTest(unittest.TestCase):
         check("driver_name", None, "test")
         check("driver_type", None, "raw")
         check("serial", "WD-WMAP9A966149", "frob")
+        check("wwn", None, "123456789abcdefa")
         check("bus", "ide", "usb")
         check("removable", None, False, True)
 
diff --git a/virtinst/cli.py b/virtinst/cli.py
index eef85f49..d4afc5c4 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -2912,6 +2912,7 @@ class ParserDisk(VirtCLIParser):
         cls.add_arg("snapshot", "snapshot_policy")
         cls.add_arg("sgio", "sgio")
         cls.add_arg("serial", "serial")
+        cls.add_arg("wwn", "wwn")
         cls.add_arg("readonly", "read_only", is_onoff=True)
         cls.add_arg("shareable", "shareable", is_onoff=True)
 
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
index bf5151f2..6556c8cd 100644
--- a/virtinst/devices/disk.py
+++ b/virtinst/devices/disk.py
@@ -657,6 +657,7 @@ class DeviceDisk(Device):
 
     error_policy = XMLProperty("./driver/@error_policy")
     serial = XMLProperty("./serial")
+    wwn = XMLProperty("./wwn")
     startup_policy = XMLProperty("./source/@startupPolicy")
     logical_block_size = XMLProperty("./blockio/@logical_block_size")
     physical_block_size = XMLProperty("./blockio/@physical_block_size")
-- 
2.20.1




More information about the virt-tools-list mailing list