This simplifies the code and avoids unnecessary parsing and re-serializing of the identical device passthrough object.
Signed-off-by: Filip Schauer <f.scha...@proxmox.com> --- src/PVE/LXC/Config.pm | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index de963bc..5d7edc4 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -1618,8 +1618,8 @@ sub vmconfig_hotplug_pending { die "skip\n"; # don't try to hotplug over existing dev } - $class->apply_pending_device_passthrough($vmid, $conf, $opt, 1); - $value = $conf->{pending}->{$opt}; + my $dev = $class->parse_device($value); + PVE::LXC::device_passthrough_hotplug($vmid, $conf, $dev); } else { die "skip\n"; # skip non-hotpluggable } @@ -1739,18 +1739,6 @@ my $rescan_volume = sub { warn "Could not rescan volume size - $@\n" if $@; }; -sub apply_pending_device_passthrough { - my ($class, $vmid, $conf, $opt, $running) = @_; - - my $dev = $class->parse_device($conf->{pending}->{$opt}); - my $old = $conf->{$opt}; - if ($running) { - die "skip\n" if defined($old); # TODO: editing a device passthrough - PVE::LXC::device_passthrough_hotplug($vmid, $conf, $dev); - $conf->{pending}->{$opt} = $class->print_device($dev); - } -} - sub apply_pending_mountpoint { my ($class, $vmid, $conf, $opt, $storecfg, $running) = @_; -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel