From nobody Tue May 13 17:09:36 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534333999046147.48606086404652; Wed, 15 Aug 2018 04:53:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C947300270F; Wed, 15 Aug 2018 11:53:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C216418111; Wed, 15 Aug 2018 11:53:16 +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 2152818037F5; Wed, 15 Aug 2018 11:53:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7FBr7cf010079 for ; Wed, 15 Aug 2018 07:53:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id E53472027047; Wed, 15 Aug 2018 11:53:06 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8468F2026D7E for ; Wed, 15 Aug 2018 11:53:06 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 15 Aug 2018 13:52:58 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/8] qemu: monitor: Rename 'device' argument for block job control APIs 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: , MIME-Version: 1.0 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 15 Aug 2018 11:53:17 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Starting from qemu 2.7 the 'device' argument is in fact a name of the job itself. Change our APIs accordingly and adjust the error message. Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- src/qemu/qemu_monitor.c | 18 +++++++++--------- src/qemu/qemu_monitor.h | 6 +++--- src/qemu/qemu_monitor_json.c | 22 +++++++++++----------- src/qemu/qemu_monitor_json.h | 6 +++--- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 6e0644221b..9bc7aa9ed1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3306,13 +3306,13 @@ qemuMonitorDiskNameLookup(qemuMonitorPtr mon, /* Use the block-job-complete monitor command to pivot a block copy job. = */ int qemuMonitorDrivePivot(qemuMonitorPtr mon, - const char *device) + const char *jobname) { - VIR_DEBUG("device=3D%s", device); + VIR_DEBUG("jobname=3D%s", jobname); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONDrivePivot(mon, device); + return qemuMonitorJSONDrivePivot(mon, jobname); } @@ -3386,26 +3386,26 @@ qemuMonitorBlockStream(qemuMonitorPtr mon, int qemuMonitorBlockJobCancel(qemuMonitorPtr mon, - const char *device) + const char *jobname) { - VIR_DEBUG("device=3D%s", device); + VIR_DEBUG("jobname=3D%s", jobname); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONBlockJobCancel(mon, device); + return qemuMonitorJSONBlockJobCancel(mon, jobname); } int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon, - const char *device, + const char *jobname, unsigned long long bandwidth) { - VIR_DEBUG("device=3D%s, bandwidth=3D%lluB", device, bandwidth); + VIR_DEBUG("jobname=3D%s, bandwidth=3D%lluB", jobname, bandwidth); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONBlockJobSetSpeed(mon, device, bandwidth); + return qemuMonitorJSONBlockJobSetSpeed(mon, jobname, bandwidth); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 2fa8d5b51d..ac41827693 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -861,7 +861,7 @@ int qemuMonitorBlockdevMirror(qemuMonitorPtr mon, unsigned int flags) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); int qemuMonitorDrivePivot(qemuMonitorPtr mon, - const char *device) + const char *jobname) ATTRIBUTE_NONNULL(2); int qemuMonitorBlockCommit(qemuMonitorPtr mon, @@ -903,11 +903,11 @@ int qemuMonitorBlockStream(qemuMonitorPtr mon, ATTRIBUTE_NONNULL(2); int qemuMonitorBlockJobCancel(qemuMonitorPtr mon, - const char *device) + const char *jobname) ATTRIBUTE_NONNULL(2); int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon, - const char *device, + const char *jobname, unsigned long long bandwidth); typedef struct _qemuMonitorBlockJobInfo qemuMonitorBlockJobInfo; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 670089b87c..51b1fddccf 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4633,14 +4633,14 @@ qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mo= n) static int qemuMonitorJSONBlockJobError(virJSONValuePtr cmd, virJSONValuePtr reply, - const char *device) + const char *jobname) { virJSONValuePtr error; if ((error =3D virJSONValueObjectGet(reply, "error")) && (qemuMonitorJSONErrorIsClass(error, "DeviceNotActive"))) { virReportError(VIR_ERR_OPERATION_INVALID, - _("No active operation on device: %s"), device); + _("No active block job '%s'"), jobname); return -1; } @@ -4685,21 +4685,21 @@ qemuMonitorJSONBlockStream(qemuMonitorPtr mon, int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, - const char *device) + const char *jobname) { int ret =3D -1; virJSONValuePtr cmd =3D NULL; virJSONValuePtr reply =3D NULL; if (!(cmd =3D qemuMonitorJSONMakeCommand("block-job-cancel", - "s:device", device, + "s:device", jobname, NULL))) return -1; if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; - if (qemuMonitorJSONBlockJobError(cmd, reply, device) < 0) + if (qemuMonitorJSONBlockJobError(cmd, reply, jobname) < 0) goto cleanup; ret =3D 0; @@ -4713,7 +4713,7 @@ qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, - const char *device, + const char *jobname, unsigned long long speed) { int ret =3D -1; @@ -4721,7 +4721,7 @@ qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, virJSONValuePtr reply =3D NULL; if (!(cmd =3D qemuMonitorJSONMakeCommand("block-job-set-speed", - "s:device", device, + "s:device", jobname, "J:speed", speed, NULL))) return -1; @@ -4729,7 +4729,7 @@ qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; - if (qemuMonitorJSONBlockJobError(cmd, reply, device) < 0) + if (qemuMonitorJSONBlockJobError(cmd, reply, jobname) < 0) goto cleanup; ret =3D 0; @@ -4743,14 +4743,14 @@ qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, int qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, - const char *device) + const char *jobname) { int ret =3D -1; virJSONValuePtr cmd; virJSONValuePtr reply =3D NULL; cmd =3D qemuMonitorJSONMakeCommand("block-job-complete", - "s:device", device, + "s:device", jobname, NULL); if (!cmd) return -1; @@ -4758,7 +4758,7 @@ qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; - if (qemuMonitorJSONBlockJobError(cmd, reply, device) < 0) + if (qemuMonitorJSONBlockJobError(cmd, reply, jobname) < 0) goto cleanup; ret =3D 0; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 2408ab0c5b..013bee3364 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -264,7 +264,7 @@ int qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); int qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, - const char *device) + const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, @@ -307,11 +307,11 @@ int qemuMonitorJSONBlockStream(qemuMonitorPtr mon, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, - const char *device) + const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, - const char *device, + const char *jobname, unsigned long long speed) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list