From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 7FE481FF140 for ; Fri, 24 Apr 2026 11:52:12 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A344211EFF; Fri, 24 Apr 2026 11:52:11 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 24 Apr 2026 11:51:37 +0200 Message-Id: Subject: Re: [PATCH qemu-server v3 11/18] block job: switch qemu_handle_concluded_blockjob() to use QMP peer From: "Lukas Sichert" To: "Fiona Ebner" , References: <20260423093753.43199-1-f.ebner@proxmox.com> <20260423093753.43199-12-f.ebner@proxmox.com> In-Reply-To: <20260423093753.43199-12-f.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777024207242 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.700 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [blockjob.pm] Message-ID-Hash: PZ775ASA6QESOVPCPRQHFYHCP76N3FVV X-Message-ID-Hash: PZ775ASA6QESOVPCPRQHFYHCP76N3FVV X-MailFrom: l.sichert@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: On 2026-04-23 11:36, Fiona Ebner wrote: > Signed-off-by: Fiona Ebner > --- > src/PVE/QemuServer/BlockJob.pm | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob= .pm > index f76b1bde..9e8fbdd7 100644 > --- a/src/PVE/QemuServer/BlockJob.pm > +++ b/src/PVE/QemuServer/BlockJob.pm > @@ -13,7 +13,7 @@ use PVE::Storage; > use PVE::QemuServer::Agent qw(qga_check_running); > use PVE::QemuServer::Blockdev; > use PVE::QemuServer::Drive qw(checked_volume_format); > -use PVE::QemuServer::Monitor qw(mon_cmd); > +use PVE::QemuServer::Monitor qw(mon_cmd qmp_cmd vm_qmp_peer); > use PVE::QemuServer::RunState; > =20 > # If the job was started with auto-dismiss=3Dfalse, it's necessary to di= smiss it manually. Using this > @@ -23,9 +23,9 @@ use PVE::QemuServer::RunState; > # $job is the information about the job recorded on the PVE-side. > # A block node $job->{'detach-node-name'} will be detached if present. > sub qemu_handle_concluded_blockjob { > - my ($vmid, $job_id, $qmp_info, $job) =3D @_; > + my ($qmp_peer, $job_id, $qmp_info, $job) =3D @_; > =20 > - eval { mon_cmd($vmid, 'job-dismiss', id =3D> $job_id); }; > + eval { qmp_cmd($qmp_peer, 'job-dismiss', id =3D> $job_id); }; > log_warn("$job_id: failed to dismiss job - $@") if $@; > =20 > # If there was an error or if the job was cancelled, always detach t= he target. This is correct > @@ -34,7 +34,7 @@ sub qemu_handle_concluded_blockjob { > $job->{'detach-node-name'} =3D $job->{'target-node-name'} if $qmp_in= fo->{error} || $job->{cancel}; > =20 > if (my $node_name =3D $job->{'detach-node-name'}) { > - eval { PVE::QemuServer::Blockdev::detach(vm_qmp_peer($vmid), $no= de_name); }; > The 'vm_qmp_peer' command has just been introduced to this file in this commit. I'm a bit confused how it is already being removed. Am I missing something or is this a error, that happened during rebasing? > + eval { PVE::QemuServer::Blockdev::detach($qmp_peer, $node_name);= }; > log_warn($@) if $@; > } > =20 > @@ -61,7 +61,7 @@ sub qemu_blockjobs_cancel { > foreach my $job (keys %$jobs) { > my $info =3D $running_jobs->{$job}; > eval { > - qemu_handle_concluded_blockjob($vmid, $job, $info, $jobs= ->{$job}) > + qemu_handle_concluded_blockjob(vm_qmp_peer($vmid), $job,= $info, $jobs->{$job}) > if $info && $info->{status} eq 'concluded'; > }; > log_warn($@) if $@; # only warn and proceed with canceling o= ther jobs > @@ -120,8 +120,11 @@ sub monitor { > =20 > die "$job_id: '$op' has been cancelled\n" if !defined($j= ob); > =20 > - qemu_handle_concluded_blockjob($vmid, $job_id, $job, $jo= bs->{$job_id}) > - if $job && $job->{status} eq 'concluded'; > + if ($job && $job->{status} eq 'concluded') { > + qemu_handle_concluded_blockjob( > + vm_qmp_peer($vmid), $job_id, $job, $jobs->{$job_= id}, > + ); > + } > =20 > my $busy =3D $job->{busy}; > my $ready =3D $job->{ready}; > @@ -353,7 +356,7 @@ sub qemu_drive_mirror_switch_to_active_mode { > =20 > my $info =3D $running_jobs->{$job}; > if ($info->{status} eq 'concluded') { > - qemu_handle_concluded_blockjob($vmid, $job, $info, $jobs= ->{$job}); > + qemu_handle_concluded_blockjob(vm_qmp_peer($vmid), $job,= $info, $jobs->{$job}); > # The 'concluded' state should occur here if and only if= the job failed, so the > # 'die' below should be unreachable, but play it safe. > die "$job: expected job to have failed, but no error was= set\n"; > --=20 > 2.47.3