From nobody Mon Feb 9 10:30:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1628780205; cv=none; d=zohomail.com; s=zohoarc; b=UOZZGBlMLmM9vqb0tokp58mTqpPPyavQlHwePE/pf1DyjCgw5d2d8IByN1+bBX9Jl12BmU1mMX+/dC8WUk3dwmBdNzoBThss96XRz2+e5NLzBRNHZ3kylPxm2P0kcrYWj6tbkvEPNfcuJGIHsUvD3nwEt9R2S/G/SxWvS9RmdXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628780205; 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; bh=k8Wx4L+PlFANeVqkEysKxjx3tbbi5ZBWIEp0Thp5HWE=; b=dHEwzfqTAFHWI2xHtbdwo7DQZciiBJ+Co9fLSj0wL0GLSxWUIiIIjua+Q5E3jy+PXzVd7vucb7cASBg29avzwLZKiKgIDF7+aEEUQ0grDJqf7aGaPPTaWuSAKE3qzViKFnaPmb+kMlCpBEDLR2aK00Dt3a03uLks3qXfHrUElXs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1628780205805118.61595447231707; Thu, 12 Aug 2021 07:56:45 -0700 (PDT) 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-564-OTNnqGehOAaYd4R2fD1FXA-1; Thu, 12 Aug 2021 10:56:43 -0400 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 2374F18C89CC; Thu, 12 Aug 2021 14:56:38 +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 0488E752BD; Thu, 12 Aug 2021 14:56:37 +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 B7A24181A43F; Thu, 12 Aug 2021 14:56:37 +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 17CEneQU008533 for ; Thu, 12 Aug 2021 10:49:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4BC4E19C44; Thu, 12 Aug 2021 14:49:40 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2096E716 for ; Thu, 12 Aug 2021 14:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628780204; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=k8Wx4L+PlFANeVqkEysKxjx3tbbi5ZBWIEp0Thp5HWE=; b=Dlgz8qcNEWUtH7B5rac3Kg6pTj5f1mnUq6R2HH6kWEap9YUVZ+M1ICHLE3NdZbjvL2nyIa DBvCmxvVciNCGM7Oc1I/8TVFdS8bNdTHKo9zGAMU5/xKRjIGEjS8E0ETo9vndNnY1S6QHo YliIil5yMFk4Pe+18Amxy9nw/vL++88= X-MC-Unique: OTNnqGehOAaYd4R2fD1FXA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/22] qemuMonitorSetBlockIoThrottle: Remove booleans controlling used fields Date: Thu, 12 Aug 2021 16:49:07 +0200 Message-Id: <9586ee21815e150e6c026d7869e4dd8ea1e97e7d.1628778754.git.pkrempa@redhat.com> In-Reply-To: References: 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) X-ZM-MESSAGEID: 1628780207882100002 Content-Type: text/plain; charset="utf-8" All supported QEMU versions have all the fields so we can remove the booleans controlling which fields are used on the monitor. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 4 +- src/qemu/qemu_hotplug.c | 6 +-- src/qemu/qemu_monitor.c | 10 +---- src/qemu/qemu_monitor.h | 5 +-- src/qemu/qemu_monitor_json.c | 81 +++++++++++------------------------- src/qemu/qemu_monitor_json.h | 5 +-- src/qemu/qemu_process.c | 3 +- tests/qemumonitorjsontest.c | 3 +- 8 files changed, 34 insertions(+), 83 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fc7cbc8c86..66d498062e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16179,9 +16179,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, qemuDomainObjEnterMonitor(driver, vm); ret =3D qemuMonitorSetBlockIoThrottle(priv->mon, drivealias, q= devid, - &info, true, - set_fields & QEMU_BLOCK_IO= TUNE_SET_GROUP_NAME, - true); + &info); if (qemuDomainObjExitMonitor(driver, vm) < 0) ret =3D -1; if (ret < 0) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index c00e8a7852..c3c49fe080 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -566,8 +566,7 @@ qemuDomainChangeMediaBlockdev(virQEMUDriver *driver, qemuDiskConfigBlkdeviotuneEnabled(disk)) { rc =3D qemuMonitorSetBlockIoThrottle(priv->mon, NULL, diskPriv->qomName, - &disk->blkdeviotune, - true, true, true); + &disk->blkdeviotune); } if (rc =3D=3D 0) @@ -806,8 +805,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver, qemuDiskConfigBlkdeviotuneEnabled(disk)) { qemuDomainDiskPrivate *diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); if (qemuMonitorSetBlockIoThrottle(priv->mon, NULL, diskPriv->qomNa= me, - &disk->blkdeviotune, - true, true, true) < 0) + &disk->blkdeviotune) < 0) VIR_WARN("failed to set blkdeviotune for '%s' of '%s'", disk->= dst, vm->def->name); } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 5d7b686136..14fb605e92 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3333,20 +3333,14 @@ int qemuMonitorSetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qomid, - virDomainBlockIoTuneInfo *info, - bool supportMaxOptions, - bool supportGroupNameOption, - bool supportMaxLengthOptions) + virDomainBlockIoTuneInfo *info) { VIR_DEBUG("drivealias=3D%s, qomid=3D%s, info=3D%p", NULLSTR(drivealias), NULLSTR(qomid), info); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONSetBlockIoThrottle(mon, drivealias, qomid, info, - supportMaxOptions, - supportGroupNameOption, - supportMaxLengthOptions); + return qemuMonitorJSONSetBlockIoThrottle(mon, drivealias, qomid, info); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 05ec228800..f2659d650e 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1112,10 +1112,7 @@ int qemuMonitorOpenGraphics(qemuMonitor *mon, int qemuMonitorSetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qomid, - virDomainBlockIoTuneInfo *info, - bool supportMaxOptions, - bool supportGroupNameOption, - bool supportMaxLengthOptions); + virDomainBlockIoTuneInfo *info); int qemuMonitorGetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 7727d1e7fb..8e5af9f79a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5423,66 +5423,35 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io= _throttle, int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qomid, - virDomainBlockIoTuneInfo *info, - bool supportMaxOptions, - bool supportGroupNameOption, - bool supportMaxLengthOptions) + virDomainBlockIoTuneInfo *info) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) result =3D NULL; - g_autoptr(virJSONValue) args =3D NULL; - - if (!(cmd =3D qemuMonitorJSONMakeCommand("block_set_io_throttle", NULL= ))) - return -1; - - if (virJSONValueObjectCreate(&args, - "S:device", drivealias, - "S:id", qomid, - "U:bps", info->total_bytes_sec, - "U:bps_rd", info->read_bytes_sec, - "U:bps_wr", info->write_bytes_sec, - "U:iops", info->total_iops_sec, - "U:iops_rd", info->read_iops_sec, - "U:iops_wr", info->write_iops_sec, - NULL) < 0) - return -1; - - if (supportMaxOptions && - virJSONValueObjectAdd(args, - "U:bps_max", info->total_bytes_sec_max, - "U:bps_rd_max", info->read_bytes_sec_max, - "U:bps_wr_max", info->write_bytes_sec_max, - "U:iops_max", info->total_iops_sec_max, - "U:iops_rd_max", info->read_iops_sec_max, - "U:iops_wr_max", info->write_iops_sec_max, - "U:iops_size", info->size_iops_sec, - NULL) < 0) - return -1; - if (supportGroupNameOption && - virJSONValueObjectAdd(args, - "S:group", info->group_name, - NULL) < 0) - return -1; - - if (supportMaxLengthOptions && - virJSONValueObjectAdd(args, - "P:bps_max_length", - info->total_bytes_sec_max_length, - "P:bps_rd_max_length", - info->read_bytes_sec_max_length, - "P:bps_wr_max_length", - info->write_bytes_sec_max_length, - "P:iops_max_length", - info->total_iops_sec_max_length, - "P:iops_rd_max_length", - info->read_iops_sec_max_length, - "P:iops_wr_max_length", - info->write_iops_sec_max_length, - NULL) < 0) - return -1; - - if (virJSONValueObjectAppend(cmd, "arguments", &args) < 0) + if (!(cmd =3D qemuMonitorJSONMakeCommand("block_set_io_throttle", + "S:device", drivealias, + "S:id", qomid, + "U:bps", info->total_bytes_sec, + "U:bps_rd", info->read_bytes_se= c, + "U:bps_wr", info->write_bytes_s= ec, + "U:iops", info->total_iops_sec, + "U:iops_rd", info->read_iops_se= c, + "U:iops_wr", info->write_iops_s= ec, + "U:bps_max", info->total_bytes_= sec_max, + "U:bps_rd_max", info->read_byte= s_sec_max, + "U:bps_wr_max", info->write_byt= es_sec_max, + "U:iops_max", info->total_iops_= sec_max, + "U:iops_rd_max", info->read_iop= s_sec_max, + "U:iops_wr_max", info->write_io= ps_sec_max, + "U:iops_size", info->size_iops_= sec, + "S:group", info->group_name, + "P:bps_max_length", info->total= _bytes_sec_max_length, + "P:bps_rd_max_length", info->re= ad_bytes_sec_max_length, + "P:bps_wr_max_length", info->wr= ite_bytes_sec_max_length, + "P:iops_max_length", info->tota= l_iops_sec_max_length, + "P:iops_rd_max_length", info->r= ead_iops_sec_max_length, + "P:iops_wr_max_length", info->w= rite_iops_sec_max_length, + NULL))) return -1; if (qemuMonitorJSONCommand(mon, cmd, &result) < 0) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 01a3ba25f1..fbeab2bf6d 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -361,10 +361,7 @@ int qemuMonitorJSONOpenGraphics(qemuMonitor *mon, int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qomid, - virDomainBlockIoTuneInfo *info, - bool supportMaxOptions, - bool supportGroupNameOption, - bool supportMaxLengthOptions); + virDomainBlockIoTuneInfo *info); int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 0bd3cbafd6..884b3fa028 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6888,8 +6888,7 @@ qemuProcessSetupDiskThrottlingBlockdev(virQEMUDriver = *driver, continue; if (qemuMonitorSetBlockIoThrottle(qemuDomainGetMonitor(vm), NULL, - diskPriv->qomName, &disk->blkdev= iotune, - true, true, true) < 0) + diskPriv->qomName, &disk->blkdev= iotune) < 0) goto cleanup; } diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 2122d9d999..6d7ecb0ab1 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1962,8 +1962,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(= const void *opaque) goto cleanup; if (qemuMonitorJSONSetBlockIoThrottle(qemuMonitorTestGetMonitor(test), - "drive-virtio-disk1", NULL, &inf= o, true, - true, true) < 0) + "drive-virtio-disk1", NULL, &inf= o) < 0) goto cleanup; ret =3D 0; --=20 2.31.1