From 1b7824d349de6025c75f00b068ff42c952918e4c Mon Sep 17 00:00:00 2001 From: Stefan Reiter Date: Thu, 18 Jun 2020 11:05:07 +0200 Subject: [PATCH] CPUConfig: add add_cpu_json_properties() Useful for APIs and docs. Signed-off-by: Stefan Reiter --- PVE/QemuServer/CPUConfig.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PVE/QemuServer/CPUConfig.pm b/PVE/QemuServer/CPUConfig.pm index b884498..6250591 100644 --- a/PVE/QemuServer/CPUConfig.pm +++ b/PVE/QemuServer/CPUConfig.pm @@ -293,6 +293,16 @@ sub write_config { $class->SUPER::write_config($filename, $cfg); } +sub add_cpu_json_properties { + my ($prop) = @_; + + foreach my $opt (keys %$cpu_fmt) { + $prop->{$opt} = $cpu_fmt->{$opt}; + } + + return $prop; +} + sub get_cpu_models { my ($include_custom) = @_; -- 2.39.2