From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id A7AC11FF126 for ; Wed, 05 Aug 2026 17:20:25 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 572BB21A3C; Wed, 05 Aug 2026 17:20:25 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 05 Aug 2026 17:20:21 +0200 Message-Id: Subject: Re: [PATCH pve-storage v2 1/2] qemu-img: drop unused image resize timeout parameter From: "Elias Huhsovitz" To: "Jakob Klocker" , X-Mailer: aerc 0.20.0 References: <20260804090438.58491-1-j.klocker@proxmox.com> <20260804090438.58491-2-j.klocker@proxmox.com> In-Reply-To: <20260804090438.58491-2-j.klocker@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785943208114 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.051 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: FRWNU3H54VCZX6WBBJDSXIL34F2TRX4E X-Message-ID-Hash: FRWNU3H54VCZX6WBBJDSXIL34F2TRX4E X-MailFrom: e.huhsovitz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Good Refactor, no warnings/errors when resizing disk using: pvesh set /nodes/{node}/qemu/{vmid}/resize --disk scsi0 --size +{num}G and the GUI option VM->Disk Action->Resize Therefore consider it: Reviewed-by: Elias Huhsovitz Tested-by: Elias Huhsovitz On Tue Aug 4, 2026 at 11:04 AM CEST, Jakob Klocker wrote: > qemu_img_resize is only ever called with a hardcoded 10 second timeout, > so exposing it as a parameter serves no purpose. > > Signed-off-by: Jakob Klocker > --- > src/PVE/Storage/Common.pm | 8 ++++---- > src/PVE/Storage/LVMPlugin.pm | 2 +- > src/PVE/Storage/Plugin.pm | 2 +- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/src/PVE/Storage/Common.pm b/src/PVE/Storage/Common.pm > index 3932aee..725f623 100644 > --- a/src/PVE/Storage/Common.pm > +++ b/src/PVE/Storage/Common.pm > @@ -259,16 +259,16 @@ sub qemu_img_measure { > =20 > =3Dhead3 qemu_img_resize > =20 > - qemu_img_resize($path, $format, $size, $preallocation, $timeout) > + qemu_img_resize($path, $format, $size, $preallocation) > =20 > Resize a qemu image C<$path> with format C<$format> to a target Kb size = C<$size>. > -Default timeout C<$timeout> is 10s if not specified. > C<$preallocation> allows to specify the preallocation option for the res= ize operation. > +The operation uses a default timeout of 10s. > =20 > =3Dcut > =20 > sub qemu_img_resize { > - my ($path, $format, $size, $preallocation, $timeout) =3D @_; > + my ($path, $format, $size, $preallocation) =3D @_; > =20 > die "format is missing" if !$format; > =20 > @@ -276,7 +276,7 @@ sub qemu_img_resize { > push $cmd->@*, "--preallocation=3D$preallocation" if $preallocation; > push $cmd->@*, '-f', $format, $path, $size; > =20 > - $timeout =3D 10 if !$timeout; > + my $timeout =3D 10; > run_command($cmd, timeout =3D> $timeout); > } > =20 > diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm > index b8646c2..768ff95 100644 > --- a/src/PVE/Storage/LVMPlugin.pm > +++ b/src/PVE/Storage/LVMPlugin.pm > @@ -1081,7 +1081,7 @@ sub volume_resize { > =20 > if (!$running && $format eq 'qcow2') { > my $preallocation =3D PVE::Storage::Plugin::preallocation_cmd_op= t($scfg, $format); > - PVE::Storage::Common::qemu_img_resize($path, $format, $size, $pr= eallocation, 10); > + PVE::Storage::Common::qemu_img_resize($path, $format, $size, $pr= eallocation); > } > =20 > return 1; > diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm > index 4f69f9b..082355d 100644 > --- a/src/PVE/Storage/Plugin.pm > +++ b/src/PVE/Storage/Plugin.pm > @@ -1373,7 +1373,7 @@ sub volume_resize { > my $format =3D ($class->parse_volname($volname))[6]; > =20 > my $preallocation =3D preallocation_cmd_opt($scfg, $format); > - PVE::Storage::Common::qemu_img_resize($path, $format, $size, $preall= ocation, 10); > + PVE::Storage::Common::qemu_img_resize($path, $format, $size, $preall= ocation); > =20 > return undef; > }