all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Filip Schauer <f.schauer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container] fix #5666: fix quota regression due to device passthrough
Date: Tue, 27 Aug 2024 13:46:43 +0200	[thread overview]
Message-ID: <20240827114643.75506-1-f.schauer@proxmox.com> (raw)

This commit fixes a regression introduced by
commit ce1976b85361 ("Add device passthrough")

Prior to the addition of device passthrough, the `lxc-pve-autodev-hook`
would invoke `PVE::LXC::Tools::for_current_devices` only once. If the
device list was empty, `exit 0` would be called and the
`lxc-pve-autodev-hook` would exit.

However, with the new device passthrough logic, when no devices were
passed through, the `exit` call would be encountered prematurely.
This would prevent the subsequent iteration over passthrough mounts from
occurring.

This commit resolves the issue by replacing the premature `exit` call
with a `return` statement, ensuring the `lxc-pve-autodev-hook` continues
executing and processes the passthrough mounts as expected.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
 src/PVE/LXC/Tools.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Tools.pm b/src/PVE/LXC/Tools.pm
index 7e3e530..3380c62 100644
--- a/src/PVE/LXC/Tools.pm
+++ b/src/PVE/LXC/Tools.pm
@@ -89,7 +89,7 @@ sub for_devices {
     my $fd;
 
     if (! open $fd, '<', $devlist_file) {
-	exit 0 if $!{ENOENT}; # If the list is empty the file might not exist.
+	return if $!{ENOENT}; # If the list is empty the file might not exist.
 	die "failed to open device list: $!\n";
     }
 
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2024-08-27 11:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 11:46 Filip Schauer [this message]
2024-09-06 17:17 ` [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=20240827114643.75506-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 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