cli: add --features kvm.hint-dedicated.state=

QEMU version 2.12.1 introduced a performance feature under commit
be7773268d98 ("target-i386: add KVM_HINTS_DEDICATED performance hint").
Support for this performance hint was added in libvirt 5.7.0 by commit
cb12c59dac04 ("qemu: support for kvm-hint-dedicated performance hint").

This patch extends virt-install's existing --features option to insert the
appropriate XML into the guest definition if this feature is specified
on the command line.

    E.g. --features='kvm.hint-dedicated.state=on' would result
    in the following XML:

      <features>
        ...
        <kvm>
          <hint-dedicated state='on'/>
        </kvm>
        ...
      </features>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
This commit is contained in:
Menno Lageman 2019-08-13 08:57:13 +02:00 committed by Cole Robinson
parent 1f0c262051
commit 0254558e6e
4 changed files with 5 additions and 2 deletions

View File

@ -65,6 +65,7 @@
<vmport state="off"/>
<kvm>
<hidden state="on"/>
<hint-dedicated state="on"/>
</kvm>
<pvspinlock state="off"/>
<smm state="off"/>

View File

@ -546,7 +546,7 @@ c.add_compare("""
--vcpus vcpu.current=3,maxvcpus=4,vcpu.placement=auto
--memory hotplugmemorymax=2048,hotplugmemoryslots=2
--disk none
--features apic.eoi=off,hap=on,hyperv.synic.state=on,hyperv.reset.state=off,hyperv.spinlocks.state=on,hyperv.spinlocks.retries=5678,pae=on,pmu.state=on,pvspinlock.state=off,smm.state=off,viridian=on,vmcoreinfo.state=on,vmport.state=off,kvm.hidden.state=on,hyperv.vapic.state=off,hyperv.relaxed.state=off,gic.version=host
--features apic.eoi=off,hap=on,hyperv.synic.state=on,hyperv.reset.state=off,hyperv.spinlocks.state=on,hyperv.spinlocks.retries=5678,pae=on,pmu.state=on,pvspinlock.state=off,smm.state=off,viridian=on,vmcoreinfo.state=on,vmport.state=off,kvm.hidden.state=on,hyperv.vapic.state=off,hyperv.relaxed.state=off,gic.version=host,kvm.hint-dedicated.state=on
--clock rtc_present=no,pit_present=yes,pit_tickpolicy=catchup,tsc_present=no,platform_present=no,hypervclock_present=no,platform_tickpolicy=foo,hpet_tickpolicy=bar,tsc_tickpolicy=wibble,kvmclock_tickpolicy=wobble,hypervclock_tickpolicy=woo
--boot bios.useserial=no,bios.rebootTimeout=60,cmdline=root=/foo,smbios.mode=host,bootmenu.enable=yes,loader_ro=yes,loader.type=rom,loader=/tmp/foo
--memorybacking access.mode=shared,source.type=anonymous,hugepages=on
@ -560,7 +560,7 @@ c.add_compare("""
--memballoon default
--sysinfo bios.vendor="Acme LLC",bios.version=1.2.3,bios.date=01/01/1970,bios.release=10.22,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,baseBoard.manufacturer="Acme Corp.",baseBoard.product=Motherboard,baseBoard.version=A01,baseBoard.serial=1234-5678,baseBoard.asset=Tag,baseBoard.location=Chassis
""", "singleton-config-3", predefine_check="5.3.0")
""", "singleton-config-3", predefine_check="5.7.0")

View File

@ -2503,6 +2503,7 @@ class ParserFeatures(VirtCLIParser):
cls.add_arg("vmport.state", "vmport", is_onoff=True)
cls.add_arg("kvm.hidden.state", "kvm_hidden", is_onoff=True)
cls.add_arg("kvm.hint-dedicated.state", "kvm_hint_dedicated", is_onoff=True)
cls.add_arg("pvspinlock.state", "pvspinlock", is_onoff=True)
cls.add_arg("gic.version", "gic_version")

View File

@ -36,6 +36,7 @@ class DomainFeatures(XMLBuilder):
vmport = XMLProperty("./vmport/@state", is_onoff=True)
kvm_hidden = XMLProperty("./kvm/hidden/@state", is_onoff=True)
kvm_hint_dedicated = XMLProperty("./kvm/hint-dedicated/@state", is_onoff=True)
pvspinlock = XMLProperty("./pvspinlock/@state", is_onoff=True)
smm = XMLProperty("./smm/@state", is_onoff=True)