all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container] config: remove apply_pending_device_passthrough helper
@ 2025-07-30 12:34 Filip Schauer
  2025-07-30 13:18 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Filip Schauer @ 2025-07-30 12:34 UTC (permalink / raw)
  To: pve-devel

This simplifies the code and avoids unnecessary parsing and
re-serializing of the identical device passthrough object.

Signed-off-by: Filip Schauer <f.schauer@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-30 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-30 12:34 [pve-devel] [PATCH container] config: remove apply_pending_device_passthrough helper Filip Schauer
2025-07-30 13:18 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal