[pve-devel] [PATCH container] fix #2080: fix device encoding in the prestart hook

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Feb 4 10:42:02 CET 2019


Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 src/lxc-pve-prestart-hook | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook
index 7933071..6e9c589 100755
--- a/src/lxc-pve-prestart-hook
+++ b/src/lxc-pve-prestart-hook
@@ -109,8 +109,8 @@ __PACKAGE__->register_method ({
 	    foreach my $dev (@$devices) {
 		my ($mode, $rdev) = (stat($dev))[2,6];
 		next if !$mode || !S_ISBLK($mode) || !$rdev;
-		my $major = int($rdev / 0x100);
-		my $minor = $rdev % 0x100;
+		my $major = PVE::Tools::dev_t_major($rdev);
+		my $minor = PVE::Tools::dev_t_minor($rdev);
 		$devlist .= "b:$major:$minor:$dev\n";
 	    }
 	    PVE::Tools::file_set_contents($devlist_file, $devlist);
-- 
2.11.0




More information about the pve-devel mailing list