Re: [virt-tools-list] [ [PATCH 1/3] cli: disk: add pr.managed=, pr.type=, pr.path= and pr.mode= support

2018-10-09 Thread Cole Robinson

On 10/08/2018 10:46 PM, Lin Ma wrote:


On 10/2/18 11:00 PM, Cole Robinson wrote:

On 09/25/2018 05:12 AM, Lin Ma wrote:
Enable the managed or unmanaged PR configuration to enable SCSI 
persistent

reservation for LUN Passthrough.

Signed-off-by: Lin Ma 
---
  man/virt-install.pod    | 13 +
  .../compare/virt-install-many-devices.xml   |  9 +
  tests/clitest.py    |  1 +
  virtinst/cli.py |  5 +
  virtinst/devices/disk.py    |  5 +
  5 files changed, 33 insertions(+)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 657ef8cb..abb9d40d 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -739,6 +739,19 @@ Defines default behavior of the disk during disk 
snapshots.  See possible

  values in L,
  "snapshot" attribute of the  element.
  +=item B
+
+It enables SCSI persistent reservations for LUN passthrough disks.
+For possible values, Please refer toPlease refer
+L,
+"reservations" attribute of the  element.
+
+e.g.
+
+--disk /dev/sdb,device=lun,bus=scsi,pr.managed=yes
+
+--disk 
/dev/sdc,device=lun,bus=scsi,pr.managed=no,pr.type=unix,pr.path=/tmp/pr-helper0.sock,pr.mode=client 


+
  =back



I don't think this needs to be documented in the manpage. It's 
poweruser enough that users can figure it out on the command line via 
--disk help output. So please drop this bit


For new options I'm trying to get closer to the libvirt XML naming, so 
it's more discoverable and predictable. So I'd like the command line 
ot be


--disk 
reservations.managed=no,reservations.source.type=unix,reservations.source.path=/tmp/pr-helper0.sock,reservations.source.mode=client 



For virt-install, I want to drop the reservations.source.type, 
reservations.source.path and reservations.source.mode as well,

only support "--disk reservations.managed=yes", Would you agree?



Actually for virt-install/virt-xml I think it's good to support every 
XML property, so I'd prefer to keep them especially since you already 
did the work


Thanks,
Cole

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [ [PATCH 1/3] cli: disk: add pr.managed=, pr.type=, pr.path= and pr.mode= support

2018-10-08 Thread Lin Ma


On 10/2/18 11:00 PM, Cole Robinson wrote:

On 09/25/2018 05:12 AM, Lin Ma wrote:
Enable the managed or unmanaged PR configuration to enable SCSI 
persistent

reservation for LUN Passthrough.

Signed-off-by: Lin Ma 
---
  man/virt-install.pod    | 13 +
  .../compare/virt-install-many-devices.xml   |  9 +
  tests/clitest.py    |  1 +
  virtinst/cli.py |  5 +
  virtinst/devices/disk.py    |  5 +
  5 files changed, 33 insertions(+)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 657ef8cb..abb9d40d 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -739,6 +739,19 @@ Defines default behavior of the disk during disk 
snapshots.  See possible

  values in L,
  "snapshot" attribute of the  element.
  +=item B
+
+It enables SCSI persistent reservations for LUN passthrough disks.
+For possible values, Please refer toPlease refer
+L,
+"reservations" attribute of the  element.
+
+e.g.
+
+--disk /dev/sdb,device=lun,bus=scsi,pr.managed=yes
+
+--disk 
/dev/sdc,device=lun,bus=scsi,pr.managed=no,pr.type=unix,pr.path=/tmp/pr-helper0.sock,pr.mode=client

+
  =back



I don't think this needs to be documented in the manpage. It's 
poweruser enough that users can figure it out on the command line via 
--disk help output. So please drop this bit


For new options I'm trying to get closer to the libvirt XML naming, so 
it's more discoverable and predictable. So I'd like the command line 
ot be


--disk 
reservations.managed=no,reservations.source.type=unix,reservations.source.path=/tmp/pr-helper0.sock,reservations.source.mode=client


For virt-install, I want to drop the reservations.source.type, 
reservations.source.path and reservations.source.mode as well,

only support "--disk reservations.managed=yes", Would you agree?

Thanks for your review,
Lin

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [ [PATCH 1/3] cli: disk: add pr.managed=, pr.type=, pr.path= and pr.mode= support

2018-10-02 Thread Cole Robinson

On 09/25/2018 05:12 AM, Lin Ma wrote:

Enable the managed or unmanaged PR configuration to enable SCSI persistent
reservation for LUN Passthrough.

Signed-off-by: Lin Ma 
---
  man/virt-install.pod| 13 +
  .../compare/virt-install-many-devices.xml   |  9 +
  tests/clitest.py|  1 +
  virtinst/cli.py |  5 +
  virtinst/devices/disk.py|  5 +
  5 files changed, 33 insertions(+)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 657ef8cb..abb9d40d 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -739,6 +739,19 @@ Defines default behavior of the disk during disk 
snapshots.  See possible
  values in L,
  "snapshot" attribute of the  element.
  
+=item B

+
+It enables SCSI persistent reservations for LUN passthrough disks.
+For possible values, Please refer toPlease refer
+L,
+"reservations" attribute of the  element.
+
+e.g.
+
+--disk /dev/sdb,device=lun,bus=scsi,pr.managed=yes
+
+--disk 
/dev/sdc,device=lun,bus=scsi,pr.managed=no,pr.type=unix,pr.path=/tmp/pr-helper0.sock,pr.mode=client
+
  =back



I don't think this needs to be documented in the manpage. It's poweruser 
enough that users can figure it out on the command line via --disk help 
output. So please drop this bit


For new options I'm trying to get closer to the libvirt XML naming, so 
it's more discoverable and predictable. So I'd like the command line ot be


--disk 
reservations.managed=no,reservations.source.type=unix,reservations.source.path=/tmp/pr-helper0.sock,reservations.source.mode=client



  See the examples section for some uses. This option deprecates -f/--file,
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 25070b1b..20071439 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -160,6 +160,15 @@


  
+
+  
+  
+
+  
+
+  
+  
+
  

  
diff --git a/tests/clitest.py b/tests/clitest.py
index 04795e05..47e2b6dc 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -438,6 +438,7 @@ c.add_compare(""" \
  --disk 
/var,device=floppy,address.type=ccw,address.cssid=0xfe,address.ssid=0,address.devno=01
 \
  --disk %(NEWIMG2)s,size=1,backing_store=/tmp/foo.img,backing_format=vmdk \
  --disk /tmp/brand-new.img,size=1,backing_store=/dev/default-pool/iso-vol \
+--disk 
path=/dev/sda,device=lun,bus=scsi,pr.managed=no,pr.type=unix,pr.path=/var/run/test/pr-helper0.sock,pr.mode=client
 \
  \
  --network 
user,mac=12:34:56:78:11:22,portgroup=foo,link_state=down,rom_bar=on,rom_file=/tmp/foo
 \
  --network bridge=foobar,model=virtio,driver_name=qemu,driver_queues=3 \
diff --git a/virtinst/cli.py b/virtinst/cli.py
index d7cb3ac3..b2adbcd2 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -2130,6 +2130,11 @@ ParserDisk.add_arg("geometry_heads", "geometry.heads")
  ParserDisk.add_arg("geometry_secs", "geometry.secs")
  ParserDisk.add_arg("geometry_trans", "geometry.trans")
  
+ParserDisk.add_arg("pr_managed", "pr.managed")

+ParserDisk.add_arg("pr_type", "pr.type")
+ParserDisk.add_arg("pr_path", "pr.path")
+ParserDisk.add_arg("pr_mode", "pr.mode")
+



  #
  # --network parsing #
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
index d3ec27f9..8b125e16 100644
--- a/virtinst/devices/disk.py
+++ b/virtinst/devices/disk.py
@@ -836,6 +836,11 @@ class DeviceDisk(Device):
  geometry_secs = XMLProperty("./geometry/@secs", is_int=True)
  geometry_trans = XMLProperty("./geometry/@trans")
  
+pr_managed = XMLProperty("./source/reservations/@managed")

+pr_type = XMLProperty("./source/reservations/source/@type")
+pr_path = XMLProperty("./source/reservations/source/@path")
+pr_mode = XMLProperty("./source/reservations/source/@mode")
+


Similarly rename these properties reservation_X and reservation_source_X

Patch looks good otherwise.

Thanks,
Cole

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


[virt-tools-list] [ [PATCH 1/3] cli: disk: add pr.managed=, pr.type=, pr.path= and pr.mode= support

2018-09-25 Thread Lin Ma
Enable the managed or unmanaged PR configuration to enable SCSI persistent
reservation for LUN Passthrough.

Signed-off-by: Lin Ma 
---
 man/virt-install.pod| 13 +
 .../compare/virt-install-many-devices.xml   |  9 +
 tests/clitest.py|  1 +
 virtinst/cli.py |  5 +
 virtinst/devices/disk.py|  5 +
 5 files changed, 33 insertions(+)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 657ef8cb..abb9d40d 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -739,6 +739,19 @@ Defines default behavior of the disk during disk 
snapshots.  See possible
 values in L,
 "snapshot" attribute of the  element.
 
+=item B
+
+It enables SCSI persistent reservations for LUN passthrough disks.
+For possible values, Please refer toPlease refer
+L,
+"reservations" attribute of the  element.
+
+e.g.
+
+--disk /dev/sdb,device=lun,bus=scsi,pr.managed=yes
+
+--disk 
/dev/sdc,device=lun,bus=scsi,pr.managed=no,pr.type=unix,pr.path=/tmp/pr-helper0.sock,pr.mode=client
+
 =back
 
 See the examples section for some uses. This option deprecates -f/--file,
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 25070b1b..20071439 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -160,6 +160,15 @@
   
   
 
+
+  
+  
+
+  
+
+  
+  
+
 
   
 
diff --git a/tests/clitest.py b/tests/clitest.py
index 04795e05..47e2b6dc 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -438,6 +438,7 @@ c.add_compare(""" \
 --disk 
/var,device=floppy,address.type=ccw,address.cssid=0xfe,address.ssid=0,address.devno=01
 \
 --disk %(NEWIMG2)s,size=1,backing_store=/tmp/foo.img,backing_format=vmdk \
 --disk /tmp/brand-new.img,size=1,backing_store=/dev/default-pool/iso-vol \
+--disk 
path=/dev/sda,device=lun,bus=scsi,pr.managed=no,pr.type=unix,pr.path=/var/run/test/pr-helper0.sock,pr.mode=client
 \
 \
 --network 
user,mac=12:34:56:78:11:22,portgroup=foo,link_state=down,rom_bar=on,rom_file=/tmp/foo
 \
 --network bridge=foobar,model=virtio,driver_name=qemu,driver_queues=3 \
diff --git a/virtinst/cli.py b/virtinst/cli.py
index d7cb3ac3..b2adbcd2 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -2130,6 +2130,11 @@ ParserDisk.add_arg("geometry_heads", "geometry.heads")
 ParserDisk.add_arg("geometry_secs", "geometry.secs")
 ParserDisk.add_arg("geometry_trans", "geometry.trans")
 
+ParserDisk.add_arg("pr_managed", "pr.managed")
+ParserDisk.add_arg("pr_type", "pr.type")
+ParserDisk.add_arg("pr_path", "pr.path")
+ParserDisk.add_arg("pr_mode", "pr.mode")
+
 
 #
 # --network parsing #
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
index d3ec27f9..8b125e16 100644
--- a/virtinst/devices/disk.py
+++ b/virtinst/devices/disk.py
@@ -836,6 +836,11 @@ class DeviceDisk(Device):
 geometry_secs = XMLProperty("./geometry/@secs", is_int=True)
 geometry_trans = XMLProperty("./geometry/@trans")
 
+pr_managed = XMLProperty("./source/reservations/@managed")
+pr_type = XMLProperty("./source/reservations/source/@type")
+pr_path = XMLProperty("./source/reservations/source/@path")
+pr_mode = XMLProperty("./source/reservations/source/@mode")
+
 
 #
 # Validation assistance methods #
-- 
2.19.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list