From nobody Sun Feb 8 18:09:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1563467514; cv=none; d=zoho.com; s=zohoarc; b=GcLLyUoRb2Y5LzvUSgX4Hulsxk4V+0q7XjHSlm9gt4/h1Fvh6tGrSpjRc+IQ72nGgSWPRLe8hm7SR6hORAtIka3eBRegRvwsbHbO1JRHBPXYeCO+cdvwYDjum6Tg0yu6wiIfKbftkATbYiqFL8PbGmgEJLfIF/mCn3Y7Ritxj/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563467514; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=PQOJ4C2INbFQW8t1FyPlXsNaNS5b3KQDDnIVnb8V2AI=; b=PXuxi++Qhn9SWeuW7koIV/kypQHtXTX3HFeaUgYbJ6eIXZAVxV7XLWnBalqEsu2MfzxC9AEJ/4TqFzqk6wQ4hPltrrw0O8FlgCDPsnPp1roS9IGV2XTlWh+gPlRWS4Ycm/GElQPgnAey2RFB2xBRhTtTtDR+hnklEcZYxMnhnPs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563467514012679.1195095052775; Thu, 18 Jul 2019 09:31:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1218E3092666; Thu, 18 Jul 2019 16:31:52 +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 C9FD75C220; Thu, 18 Jul 2019 16:31:51 +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 DA6534E58E; Thu, 18 Jul 2019 16:31:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6IGVl9K005170 for ; Thu, 18 Jul 2019 12:31:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id D8406608A6; Thu, 18 Jul 2019 16:31:47 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6216060A35 for ; Thu, 18 Jul 2019 16:31:47 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 18 Jul 2019 18:31:36 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/8] qemu: driver: blockdevize qemuDomainGetBlockJobInfo 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 18 Jul 2019 16:31:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Use the stored job name rather than passing in the disk alias when refering to the job which allows the same code to work also when -blockdev will be used. Note that this API does not require the change to use 'query-job' as it will ever only work with blockjobs bound to disks due to the arguments which allow only refering to a disk. For the disk-less jobs we'll need to add a separate API later. The change to qemuMonitorGetBlockJobInfo is required as the API was striping the 'drive-' prefix when returning the data which is not desired any more. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 9 +++++++-- src/qemu/qemu_monitor.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 329c166255..739cbc5ed3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17292,6 +17292,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, virDomainDiskDefPtr disk; int ret =3D -1; qemuMonitorBlockJobInfo rawInfo; + VIR_AUTOUNREF(qemuBlockJobDataPtr) job =3D NULL; virCheckFlags(VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES, -1); @@ -17314,9 +17315,13 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, goto endjob; } + if (!(job =3D qemuBlockJobDiskGetJob(disk))) { + ret =3D 0; + goto endjob; + } + qemuDomainObjEnterMonitor(driver, vm); - ret =3D qemuMonitorGetBlockJobInfo(qemuDomainGetMonitor(vm), - disk->info.alias, &rawInfo); + ret =3D qemuMonitorGetBlockJobInfo(qemuDomainGetMonitor(vm), job->name= , &rawInfo); if (qemuDomainObjExitMonitor(driver, vm) < 0) ret =3D -1; if (ret <=3D 0) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 5ad66d1dca..a880da3ab6 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3463,7 +3463,7 @@ qemuMonitorGetBlockJobInfo(qemuMonitorPtr mon, VIR_DEBUG("alias=3D%s, info=3D%p", alias, info); - if (!(all =3D qemuMonitorGetAllBlockJobInfo(mon, false))) + if (!(all =3D qemuMonitorGetAllBlockJobInfo(mon, true))) return -1; if ((data =3D virHashLookup(all, alias))) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list