cli: Add --disk driver.copy_on_read=on option

This maps to disk XML like:

    <disk>
      <driver copy_on_read='on'/>
    </disk>

Signed-off-by: Anya Harter <aharter@redhat.com>
This commit is contained in:
Anya Harter 2018-06-07 10:45:46 -04:00 committed by Cole Robinson
parent 96414aa88a
commit 89c389e45a
4 changed files with 5 additions and 1 deletions

View File

@ -42,6 +42,7 @@
</disk>
<disk type="file" device="cdrom">
<target dev="sda" bus="sata"/>
<driver copy_on_read="on"/>
<iotune>
<read_bytes_sec>1</read_bytes_sec>
<write_bytes_sec>5</write_bytes_sec>

View File

@ -462,7 +462,7 @@ c.add_compare(""" \
\
--disk %(EXISTUPPER)s,cache=writeback,io=threads,perms=sh,serial=WD-WMAP9A966149,boot_order=2 \
--disk %(NEWIMG1)s,sparse=false,size=.001,perms=ro,error_policy=enospace,discard=unmap,detect_zeroes=yes \
--disk device=cdrom,bus=sata,read_bytes_sec=1,read_iops_sec=2,total_bytes_sec=10,total_iops_sec=20,write_bytes_sec=5,write_iops_sec=6 \
--disk device=cdrom,bus=sata,read_bytes_sec=1,read_iops_sec=2,total_bytes_sec=10,total_iops_sec=20,write_bytes_sec=5,write_iops_sec=6,driver.copy_on_read=on \
--disk size=1 \
--disk %(BLOCKVOL)s \
--disk /dev/default-pool/iso-vol,seclabel.model=dac,seclabel1.model=selinux,seclabel1.relabel=no,seclabel0.label=foo,bar,baz \

View File

@ -2117,6 +2117,7 @@ ParserDisk.add_arg("driver_discard", "discard")
ParserDisk.add_arg("driver_detect_zeroes", "detect_zeroes")
ParserDisk.add_arg("driver_name", "driver_name")
ParserDisk.add_arg("driver_type", "driver_type")
ParserDisk.add_arg("driver_copy_on_read", "driver.copy_on_read", is_onoff=True)
ParserDisk.add_arg("driver_io", "io")
ParserDisk.add_arg("error_policy", "error_policy")
ParserDisk.add_arg("serial", "serial")

View File

@ -745,6 +745,8 @@ class DeviceDisk(Device):
driver_type = XMLProperty("./driver/@type",
default_cb=_get_default_driver_type)
driver_copy_on_read = XMLProperty("./driver/@copy_on_read", is_onoff=True)
sgio = XMLProperty("./@sgio")
bus = XMLProperty("./target/@bus")