[pve-devel] [PATCH container v3 5/8] api: create: create_ct_determine_mp_param: improve code style

Fiona Ebner f.ebner at proxmox.com
Fri Jan 23 15:34:25 CET 2026


Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---

New in v3.

 src/PVE/API2/LXC.pm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 8623d63..f7d5de4 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -177,7 +177,8 @@ my sub create_ct_determine_mp_param {
             if ($type eq 'volume') {
                 die "unable to detect disk size - please specify $ms (size)\n"
                     if !defined($mountpoint->{size});
-                my $disksize = $mountpoint->{size} / (1024 * 1024 * 1024); # create_disks expects GB as unit size
+                # create_disks expects GB as unit size
+                my $disksize = $mountpoint->{size} / (1024 * 1024 * 1024);
                 delete $mountpoint->{size};
                 $mountpoint->{volume} = "$storage:$disksize";
                 $mp_param->{$ms} = PVE::LXC::Config->print_ct_mountpoint(
@@ -185,9 +186,10 @@ my sub create_ct_determine_mp_param {
                 );
             } else {
                 my $type = $mountpoint->{type};
-                die
-                    "restoring rootfs to $type mount is only possible by specifying -rootfs manually!\n"
-                    if ($ms eq 'rootfs');
+                if ($ms eq 'rootfs') {
+                    die "restoring rootfs to $type mount is only possible by specifying -rootfs"
+                        . " manually!\n";
+                }
                 die "restoring '$ms' to $type mount is only possible for root\n"
                     if !$is_root;
 
-- 
2.47.3





More information about the pve-devel mailing list