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 83BDA1FF0E2 for ; Thu, 30 Jul 2026 15:18:18 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 5AFB121569; Thu, 30 Jul 2026 15:17:53 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server 8/8] block job: monitor: properly document function Date: Thu, 30 Jul 2026 15:15:57 +0200 Message-ID: <20260730131613.157722-9-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260730131613.157722-1-f.ebner@proxmox.com> References: <20260730131613.157722-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785417458536 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.158 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) 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: N2RHNN56VV2B27I7YF4JOSXJOFXTRJ7I X-Message-ID-Hash: N2RHNN56VV2B27I7YF4JOSXJOFXTRJ7I X-MailFrom: f.ebner@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: Signed-off-by: Fiona Ebner --- src/PVE/QemuServer/BlockJob.pm | 56 +++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob.pm index 5fbc311e..2f4bf3cc 100644 --- a/src/PVE/QemuServer/BlockJob.pm +++ b/src/PVE/QemuServer/BlockJob.pm @@ -108,11 +108,57 @@ my sub print_job_status { return; } -# $completion can be either -# 'complete': wait until all jobs are ready, job-complete them (default) -# 'cancel': wait until all jobs are ready, block-job-cancel them -# 'skip': wait until all jobs are ready, return with block jobs in ready state -# 'auto': wait until all jobs disappear, only use for jobs which complete automatically +=head3 monitor + +Monitor the given jobs C<$jobs> and handle them according to the mode C<$completion>. + +=over + +=item C<$qmp_peer>: The QMP peer which is executing the jobs. + +=item C<$jobs>: Hash reference with job IDs that should be handled. With optional, additional +information: + +=over + +=item C<< $jobs->{$job_id}->{'source-node-name'} >>: (optional, used by mirror) Name of the source +block node. Will be detached upon completion. + +=item C<< $jobs->{$job_id}->{'target-node-name'} >>: (optional, used by mirror) Name of the target +block node. Will be detached upon cancel. + +=back + +=item C<$completion>: How to handle the jobs: + +=over + +=item C<'complete'>: wait until all jobs are ready, job-complete them (default) + +=item C<'cancel'>: wait until all jobs are ready, block-job-cancel them + +=item C<'skip'>: wait until all jobs are ready, return with block jobs in ready state + +=item C<'auto'>: wait until all jobs disappear, only use for jobs which complete automatically + +=back + +=item C<$operation>: Name of the block job operation. + +=item C<$options>: Additional options: + +=over + +=item C<< $options->{qga} >>: Guest agent string to be considered for guest filesystem freezing. + +=item C<< $options->{'dest-vmid'} >>: VM ID of the target of the job. + +=back + +=back + +=cut + sub monitor { my ($qmp_peer, $jobs, $completion, $operation, $options) = @_; -- 2.47.3