mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
cpu: add helper function to reset cpu related variables to none
The helper function aims to reset cpu related vars to none except <topology>. It is named with clear_attrs(). clear() could be saved for later use of clearing all of them including <topology>.
This commit is contained in:
parent
15f72a84ab
commit
e941a9e92b
@ -187,6 +187,15 @@ class CPU(XMLBuilderDomain.XMLBuilderDomain):
|
|||||||
get_converter=lambda s, x: _int_or_none(x),
|
get_converter=lambda s, x: _int_or_none(x),
|
||||||
xpath="./cpu/topology/@threads")
|
xpath="./cpu/topology/@threads")
|
||||||
|
|
||||||
|
def clear_attrs(self):
|
||||||
|
self.match = None
|
||||||
|
self.mode = None
|
||||||
|
self.vendor = None
|
||||||
|
self.model = None
|
||||||
|
|
||||||
|
for feature in self.features:
|
||||||
|
self.remove_feature(feature)
|
||||||
|
|
||||||
def copy_host_cpu(self):
|
def copy_host_cpu(self):
|
||||||
"""
|
"""
|
||||||
Enact the equivalent of qemu -cpu host, pulling all info
|
Enact the equivalent of qemu -cpu host, pulling all info
|
||||||
|
Loading…
Reference in New Issue
Block a user