]> git.proxmox.com Git - qemu-server.git/commitdiff
print_drive: Use $skip to avoid the need to copy the hash
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 24 Feb 2020 12:43:53 +0000 (13:43 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 25 Feb 2020 11:29:38 +0000 (12:29 +0100)
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/QemuServer.pm

index 3bf60ea21a74bd3955b1e06e25768e2dd1162cfa..050c03b06b760c81f1137720060bb36c9e0f974f 100644 (file)
@@ -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 {