public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Lukas Sichert" <l.sichert@proxmox.com>
To: "Fiona Ebner" <f.ebner@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH qemu-server v3 11/18] block job: switch qemu_handle_concluded_blockjob() to use QMP peer
Date: Fri, 24 Apr 2026 11:51:37 +0200	[thread overview]
Message-ID: <DI1AJGBE4NZ8.KLL8NBVJWJI3@proxmox.com> (raw)
In-Reply-To: <20260423093753.43199-12-f.ebner@proxmox.com>

On 2026-04-23 11:36, Fiona Ebner <f.ebner@proxmox.com> wrote:

> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  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;
>  
>  # If the job was started with auto-dismiss=false, it's necessary to dismiss 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) = @_;
> +    my ($qmp_peer, $job_id, $qmp_info, $job) = @_;
>  
> -    eval { mon_cmd($vmid, 'job-dismiss', id => $job_id); };
> +    eval { qmp_cmd($qmp_peer, 'job-dismiss', id => $job_id); };
>      log_warn("$job_id: failed to dismiss job - $@") if $@;
>  
>      # If there was an error or if the job was cancelled, always detach the target. This is correct
> @@ -34,7 +34,7 @@ sub qemu_handle_concluded_blockjob {
>      $job->{'detach-node-name'} = $job->{'target-node-name'} if $qmp_info->{error} || $job->{cancel};
>  
>      if (my $node_name = $job->{'detach-node-name'}) {
> -        eval { PVE::QemuServer::Blockdev::detach(vm_qmp_peer($vmid), $node_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 $@;
>      }
>  
> @@ -61,7 +61,7 @@ sub qemu_blockjobs_cancel {
>          foreach my $job (keys %$jobs) {
>              my $info = $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 other jobs
> @@ -120,8 +120,11 @@ sub monitor {
>  
>                  die "$job_id: '$op' has been cancelled\n" if !defined($job);
>  
> -                qemu_handle_concluded_blockjob($vmid, $job_id, $job, $jobs->{$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},
> +                    );
> +                }
>  
>                  my $busy = $job->{busy};
>                  my $ready = $job->{ready};
> @@ -353,7 +356,7 @@ sub qemu_drive_mirror_switch_to_active_mode {
>  
>              my $info = $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";
> -- 
> 2.47.3





  reply	other threads:[~2026-04-24  9:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23  9:35 [PATCH-SERIES qemu-server v3 00/18] fix #7066: api: allow live snapshot (remove) of qcow2 TPM drive with snapshot-as-volume-chain Fiona Ebner
2026-04-23  9:35 ` [PATCH qemu-server v3 01/18] block job: fix variable name in documentation Fiona Ebner
2026-04-23  9:35 ` [PATCH qemu-server v3 02/18] qmp client: add default timeouts for more block commands Fiona Ebner
2026-04-23  9:35 ` [PATCH qemu-server v3 03/18] drive: introduce drive_uses_qsd_fuse() helper Fiona Ebner
2026-04-23  9:35 ` [PATCH qemu-server v3 04/18] monitor: add vm_qmp_peer() helper Fiona Ebner
2026-04-23  9:35 ` [PATCH qemu-server v3 05/18] monitor: add qsd_peer() helper Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 06/18] blockdev: rename variable in get_node_name_below_throttle() for readability Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 07/18] blockdev: switch get_node_name_below_throttle() to use QMP peer Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 08/18] blockdev: switch detach() " Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 09/18] blockdev: switch blockdev_replace() " Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 10/18] blockdev: switch blockdev_external_snapshot() " Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 11/18] block job: switch qemu_handle_concluded_blockjob() " Fiona Ebner
2026-04-24  9:51   ` Lukas Sichert [this message]
2026-04-24 11:36     ` Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 12/18] block job: switch qemu_blockjobs_cancel() " Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 13/18] block job: switch qemu_drive_mirror_monitor() " Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 14/18] blockdev: switch blockdev_delete() " Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 15/18] blockdev: switch blockdev_stream() " Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 16/18] blockdev: switch blockdev_commit() " Fiona Ebner
2026-04-24 11:49   ` Lukas Sichert
2026-04-24 11:56     ` Fiona Ebner
2026-04-24 12:09       ` Lukas Sichert
2026-04-23  9:36 ` [PATCH qemu-server v3 17/18] snapshot: support live snapshot (remove) of qcow2 TPM drive on storage with snapshot-as-volume-chain Fiona Ebner
2026-04-23  9:36 ` [PATCH qemu-server v3 18/18] fix #7066: api: allow live snapshot (remove) of qcow2 TPM drive " Fiona Ebner
2026-04-23 13:57 ` [PATCH-SERIES qemu-server v3 00/18] " Lukas Sichert
2026-04-24 11:59 ` Lukas Sichert
2026-04-24 12:11   ` superseded: " Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DI1AJGBE4NZ8.KLL8NBVJWJI3@proxmox.com \
    --to=l.sichert@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal