diff options
author | Lin Ma <lma@suse.com> | 2022-08-19 18:18:50 +0800 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2022-08-20 10:03:11 -0400 |
commit | fbdf05162606e4d70506b65d0dd647a59f229253 (patch) | |
tree | 4c6055eb3aebc0f6103ed6de6bbc35ad9c12c380 /virtinst | |
parent | c22a876e9a63cb7114e2b008f2e24682c8bbef3e (diff) | |
download | virt-manager-fbdf05162606e4d70506b65d0dd647a59f229253.tar.gz |
cli: --cpu: Add maxphysaddr.{mode,bits} options
This commit added support for cpu physical address bits control, It's
useful for VMs with huge amount of ram.
E.g.
--cpu Cascadelake-Server,maxphysaddr.mode=emulate,maxphysaddr.bits=46
Signed-off-by: Lin Ma <lma@suse.com>
Diffstat (limited to 'virtinst')
-rw-r--r-- | virtinst/cli.py | 3 | ||||
-rw-r--r-- | virtinst/domain/cpu.py | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/virtinst/cli.py b/virtinst/cli.py index 388c5263..5ac8266b 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -2386,6 +2386,9 @@ class ParserCPU(VirtCLIParser): cls.add_arg("cache.level", "cache.level") cls.add_arg("cache.mode", "cache.mode") + cls.add_arg("maxphysaddr.mode", "maxphysaddr.mode") + cls.add_arg("maxphysaddr.bits", "maxphysaddr.bits") + # CPU features # These are handled specially in _parse cls.add_arg("force", None, lookup_cb=None, cb=cls.set_feature_cb) diff --git a/virtinst/domain/cpu.py b/virtinst/domain/cpu.py index 5de42b4e..c635932e 100644 --- a/virtinst/domain/cpu.py +++ b/virtinst/domain/cpu.py @@ -102,6 +102,17 @@ class _CPUFeature(XMLBuilder): policy = XMLProperty("./@policy") +class _CPUMaxphysaddr(XMLBuilder): + """ + Class for generating XML for <cpu> child node <maxphysaddr>. + """ + XML_NAME = "maxphysaddr" + _XML_PROP_ORDER = ["mode", "bits"] + + mode = XMLProperty("./@mode") + bits = XMLProperty("./@bits", is_int=True) + + ############## # NUMA cells # ############## @@ -211,7 +222,7 @@ class DomainCpu(XMLBuilder): _XML_PROP_ORDER = ["mode", "match", "check", "migratable", "model", "model_fallback", "model_vendor_id", "vendor", "topology", "cache", "features", - "cells", "latencies", "bandwidths"] + "cells", "latencies", "bandwidths", "maxphysaddr"] ################## @@ -242,6 +253,8 @@ class DomainCpu(XMLBuilder): latencies = XMLChildProperty(_NUMALatency, relative_xpath="./numa/interconnects") bandwidths = XMLChildProperty(_NUMABandwidth, relative_xpath="./numa/interconnects") + maxphysaddr = XMLChildProperty(_CPUMaxphysaddr, is_single=True) + ############################# # Special CPU mode handling # |