From d7117b5adbffc0f6688d1a3bcd9ac14f8d4d58d6 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Mon, 24 Feb 2020 13:43:53 +0100 Subject: [PATCH] print_drive: Use $skip to avoid the need to copy the hash Signed-off-by: Fabian Ebner --- PVE/QemuServer.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 3bf60ea2..050c03b0 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1655,9 +1655,8 @@ sub parse_drive { sub print_drive { my ($drive) = @_; - my $data = { %$drive }; - delete $data->{$_} for qw(index interface); - return PVE::JSONSchema::print_property_string($data, $alldrive_fmt); + my $skip = [ 'index', 'interface' ]; + return PVE::JSONSchema::print_property_string($drive, $alldrive_fmt, $skip); } sub scsi_inquiry {