From: Filip Schauer <f.schauer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container] config: remove apply_pending_device_passthrough helper
Date: Wed, 30 Jul 2025 14:34:45 +0200 [thread overview]
Message-ID: <20250730123447.89001-1-f.schauer@proxmox.com> (raw)
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
next reply other threads:[~2025-07-30 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 12:34 Filip Schauer [this message]
2025-07-30 13:18 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250730123447.89001-1-f.schauer@proxmox.com \
--to=f.schauer@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox