we'll need this since we want to record the profile used for creation,
which we get from outside

Signed-off-by: Dominik Csapak <[email protected]>
---
 PVE/QemuServer.pm | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 0568b2bc..c22b1544 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2125,15 +2125,22 @@ sub parse_meta_info {
 }
 
 sub new_meta_info_string {
-    my () = @_; # for now do not allow to override any value
+    my ($additional_props) = @_;
 
-    return PVE::JSONSchema::print_property_string(
-       {
-           'creation-qemu' => kvm_user_version(),
-           ctime => "". int(time()),
-       },
-       $meta_info_fmt
-    );
+    $additional_props //= {};
+
+    # for now do not allow to override any value
+    delete $additional_props->{'creation-qemu'};
+    delete $additional_props->{'ctime'};
+
+    my $opts = {
+       'creation-qemu' => kvm_user_version(),
+       ctime => "". int(time()),
+    };
+
+    $opts->{$_} = $additional_props->{$_} for keys $additional_props->%*;
+
+    return PVE::JSONSchema::print_property_string($opts, $meta_info_fmt);
 }
 
 sub qemu_created_version_fixups {
-- 
2.30.2



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to