Re: [PATCH qemu-server v3 11/18] block job: switch qemu_handle_concluded_blockjob() to use QMP peer

Fiona Ebner
2026-04-24T11:36:36Z

Am 24.04.26 um 11:50 AM schrieb Lukas Sichert:
>> 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?

Good catch, adding the import for vm_qmp_peer already needs to happen in
patch 07/18 "blockdev: switch get_node_name_below_throttle() to use QMP
peer".