[pve-devel] [PATCH qemu-server 2/3] CPUConfig: add add_cpu_json_properties()

Stefan Reiter s.reiter at proxmox.com
Thu Jun 18 11:05:07 CEST 2020


Useful for APIs and docs.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 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.20.1





More information about the pve-devel mailing list