From 2e49041d85b86ad0491483427498c864fe8e2059 Mon Sep 17 00:00:00 2001 From: Athina Plaskasoviti Date: Sat, 17 Aug 2019 19:10:03 +0300 Subject: [PATCH] cli: Add --clock timer[0-9]*.catchup options Added: -timer[0-9]*.catchup.threshold -timer[0-9]*.catchup.slew -timer[0-9]*.catchup.limit Catchup attributes need timer with assigned tickpolicy=catchup. XML Mapping: ... ... Reviewed-by: Cole Robinson Signed-off-by: Athina Plaskasoviti --- .../compare/virt-install-singleton-config-2.xml | 6 ++++++ tests/clitest.py | 2 +- virtinst/cli.py | 6 ++++++ virtinst/domain/clock.py | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml index 1c5cbfce3..9d9bcb8d2 100644 --- a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml +++ b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml @@ -160,6 +160,9 @@ + + + destroy destroy @@ -397,6 +400,9 @@ + + + destroy restart diff --git a/tests/clitest.py b/tests/clitest.py index 6ad549782..3cb95b3b2 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -519,7 +519,7 @@ memnode0.cellid=1,memnode0.mode=strict,memnode0.nodeset=2 --blkiotune weight=100,device_path=/home/test/1.img,device_weight=200,read_bytes_sec=10000,write_bytes_sec=10000,read_iops_sec=20000,write_iops_sec=20000 --memorybacking size=1,unit='G',nodeset=0,1,nosharepages=yes,locked=yes,discard=yes,allocation.mode=immediate,access_mode=shared,source_type=file,hugepages.page.size=12,hugepages.page1.size=1234,hugepages.page1.unit=MB,hugepages.page1.nodeset=2 --features acpi=off,eoi=on,privnet=on,hyperv_synic=on,hyperv_reset=on,hyperv_spinlocks=on,hyperv_spinlocks_retries=5678,vmport=off,pmu=off,vmcoreinfo=on,kvm_hidden=off,hyperv_vapic=on ---clock offset=utc,hpet_present=no,rtc_tickpolicy=merge,timer2.name=hypervclock,timer3.name=pit,timer1.present=yes,timer3.tickpolicy=delay,timer2.present=no,timer4.name=rtc,timer5.name=tsc,timer6.name=tsc,timer4.track=wall,timer5.frequency=10,timer6.mode=emulate +--clock offset=utc,hpet_present=no,rtc_tickpolicy=merge,timer2.name=hypervclock,timer3.name=pit,timer1.present=yes,timer3.tickpolicy=delay,timer2.present=no,timer4.name=rtc,timer5.name=tsc,timer6.name=tsc,timer4.track=wall,timer5.frequency=10,timer6.mode=emulate,timer7.name=rtc,timer7.tickpolicy=catchup,timer7.catchup.threshold=123,timer7.catchup.slew=120,timer7.catchup.limit=10000 --sysinfo type=smbios,bios_vendor="Acme LLC",bios_version=1.2.3,bios_date=01/01/1970,bios_release=10.22 --sysinfo type=smbios,system_manufacturer="Acme Inc.",system_product=Computer,system_version=3.2.1,system_serial=123456789,system_uuid=00000000-1111-2222-3333-444444444444,system_sku=abc-123,system_family=Server --sysinfo type=smbios,baseBoard_manufacturer="Acme Corp.",baseBoard_product=Motherboard,baseBoard_version=A01,baseBoard_serial=1234-5678,baseBoard_asset=Tag,baseBoard_location=Chassis diff --git a/virtinst/cli.py b/virtinst/cli.py index df9c1f540..2d5acd276 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -2604,6 +2604,12 @@ class ParserClock(VirtCLIParser): find_inst_cb=cls.timer_find_inst_cb) cls.add_arg("timer[0-9]*.frequency", "frequency", find_inst_cb=cls.timer_find_inst_cb) + cls.add_arg("timer[0-9]*.catchup.threshold", "threshold", + find_inst_cb=cls.timer_find_inst_cb) + cls.add_arg("timer[0-9]*.catchup.slew", "slew", + find_inst_cb=cls.timer_find_inst_cb) + cls.add_arg("timer[0-9]*.catchup.limit", "limit", + find_inst_cb=cls.timer_find_inst_cb) ################ diff --git a/virtinst/domain/clock.py b/virtinst/domain/clock.py index 1647ab780..831839d67 100644 --- a/virtinst/domain/clock.py +++ b/virtinst/domain/clock.py @@ -16,6 +16,9 @@ class _ClockTimer(XMLBuilder): track = XMLProperty("./@track") mode = XMLProperty("./@mode") frequency = XMLProperty("./@frequency", is_int=True) + threshold = XMLProperty("./catchup/@threshold", is_int=True) + slew = XMLProperty("./catchup/@slew", is_int=True) + limit = XMLProperty("./catchup/@limit", is_int=True) class DomainClock(XMLBuilder):