From nobody Sun Feb 8 14:56:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607360293; cv=none; d=zohomail.com; s=zohoarc; b=iXs/pfRYXKKSd9Cx5ZyKC7E6XIGmqMUbJDKea4QnTbfqgsDHv09pi6sbH2TfwA1ZIilil/lStevly3l5zA4yn1SEgYi/J2ogwX9teF8bTlGWP91/S32kgx3Y30uKDC15moMY3XYkeNrY1s145zswEHHNcD9BzU4uhCrfJsPzq8Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607360293; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=pZLl3LNkbAQWakYzNDtJoDTCllWIGhMqpi5JobO3wgE=; b=nE8+Wiyp258YYmfY498AhThuHDXK9RDL2x9vabFgnNaAntaPyfoQtMYE3WCNJ6aRCr8bubYrF+eaSA1vwK7tqd+/j49SDumXAyyhla5Q3gdwCQxhLoKfOaHfwhlHTUiUEFP3TyEb5B1XtyfGmdcGB801po9OiKlZSQVysg0e4Es= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160736029376094.86936294165127; Mon, 7 Dec 2020 08:58:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-le4ZmKD7Ngu9n77Jpl4dQw-1; Mon, 07 Dec 2020 11:58:08 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5FDA802B6A; Mon, 7 Dec 2020 16:58:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20F435D9E2; Mon, 7 Dec 2020 16:58:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 080694E58E; Mon, 7 Dec 2020 16:58:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B7GvwIr032699 for ; Mon, 7 Dec 2020 11:57:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id DE9CF3CC9; Mon, 7 Dec 2020 16:57:58 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C63647 for ; Mon, 7 Dec 2020 16:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607360292; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=pZLl3LNkbAQWakYzNDtJoDTCllWIGhMqpi5JobO3wgE=; b=gftUjm6DX2rvKe8o3zuywJbdl70Bij1/uqVRIVcLi2NMl7WluPOPb4h3RP0J6oWdjg5JgS hgge6goK2AltYU7w+pNh9izq37rdyM/Kf8gki8F4z9NW4X1q7jMn8dtraf1PF6coyfd9dY nbmBmX+y/xPUhh2tzRV7LOTrZUJOCbM= X-MC-Unique: le4ZmKD7Ngu9n77Jpl4dQw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemuBlockJobInfoTranslate: Take job type from qemuBlockJobDataPtr Date: Mon, 7 Dec 2020 17:57:53 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit f5e8715a8b4 added logic which adds some fake job info when qemu didn't return anything but in such case the job type would not be set. Since we already have the proper job type recorded in qemuBlockJobDataPtr which the caller fetched, we can use this it and also remove the lookup from the disk which was necessary prior to the conversion to qemuBlockJobDataPtr. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- I've wanted to fix it before pushing what would become commit f5e8715a8b4 but Michal accidentally pushed it with one of his patches. src/qemu/qemu_driver.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d8478945d6..5d4697103d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14638,9 +14638,11 @@ qemuDomainBlockJobAbort(virDomainPtr dom, static int qemuBlockJobInfoTranslate(qemuMonitorBlockJobInfoPtr rawInfo, virDomainBlockJobInfoPtr info, - virDomainDiskDefPtr disk, + qemuBlockJobDataPtr job, bool reportBytes) { + info->type =3D job->type; + /* If the job data is no longer present this means that the job already * disappeared in qemu (pre-blockdev) but libvirt didn't process the * finishing yet. Fake a incomplete job. */ @@ -14674,11 +14676,6 @@ qemuBlockJobInfoTranslate(qemuMonitorBlockJobInfoP= tr rawInfo, info->cur > 0) info->cur -=3D 1; - info->type =3D rawInfo->type; - if (info->type =3D=3D VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT && - disk->mirrorJob =3D=3D VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT) - info->type =3D disk->mirrorJob; - if (rawInfo->bandwidth && !reportBytes) rawInfo->bandwidth =3D VIR_DIV_UP(rawInfo->bandwidth, 1024 * 1024); info->bandwidth =3D rawInfo->bandwidth; @@ -14737,7 +14734,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, rawInfo =3D g_hash_table_lookup(blockjobstats, job->name); - if (qemuBlockJobInfoTranslate(rawInfo, info, disk, + if (qemuBlockJobInfoTranslate(rawInfo, info, job, flags & VIR_DOMAIN_BLOCK_JOB_INFO_BANDWI= DTH_BYTES) < 0) goto endjob; --=20 2.28.0