From nobody Sun Dec 22 01:54:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1685028109; cv=none; d=zohomail.com; s=zohoarc; b=ez+htjSdhQpK+46F6dzLq0wp5m4UwDfvWmxA/xyTDgiAvDfsZ4O5/l6+TXDGDR6HyqZ/DL60ooNIfbYrVur2y5Nkr+gVvGZ+ZCbfwLf+FXS8ZS/wJA7WhIyJbl9qM10bbqUEStwrI3oRe6mlv9dn4X0WQcTrvoBxgtzOEbjVgJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685028109; 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=23D+SOgXNr892CYsHEkat//uE1zdmQQ2UWtMYZiZCYE=; b=mcjMaqh1xFJZrlZ1ODknAAPv6YUKCH3eHHLv1PG/g27e42u648giuHZbeKmCD5aPwvzpDMtQQhkmc47el6JWjRVxlBnw1hcbfyP9J9DwXJrRqYTzh3nbqfsCYshvfMm6cxFlhF1O9I2X4bxnu5BwTInOo4uxa7S40yzEIHdzyrM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1685028109292785.7458784856475; Thu, 25 May 2023 08:21:49 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-511-jqRc5z-CNzOMnG-BbzgViw-1; Thu, 25 May 2023 11:21:02 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F03E3C0F195; Thu, 25 May 2023 15:20:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16A6B140E95D; Thu, 25 May 2023 15:20:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DBA6919465A4; Thu, 25 May 2023 15:20:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0E9E619465B6 for ; Thu, 25 May 2023 15:14:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 88A2D43E904; Thu, 25 May 2023 15:14:01 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10FB443E903 for ; Thu, 25 May 2023 15:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685028107; 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=23D+SOgXNr892CYsHEkat//uE1zdmQQ2UWtMYZiZCYE=; b=RjXk76e38LyQfD6zKdVYdCBfZYk2B5lBI0c/GVHiZO2e4qEMnsCr2L8Z+O8TTtFnQv5iXe +qwWqCnPbjj35zzXZKlzyMcgQ+CtsGbd2xQ+QjtyAg3KY4/TXyRu0EMxObA8CqfI9D6cQP mNS2WH92FLqMXTemqWHjQnVqLfywiWE= X-MC-Unique: jqRc5z-CNzOMnG-BbzgViw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/18] qemuMonitorSetBlockIoThrottle: Drop 'diskalias' argument Date: Thu, 25 May 2023 17:13:44 +0200 Message-Id: <0d4f8537de4cc812f09920ac4427849dbedcfd13.1685027511.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: 1685028110258100001 Content-Type: text/plain; charset="utf-8" Every caller will pass 'qdevid' as it's populated in the data madatorily with qemu-4.2 and onwards due to mandatory -blockdev use. Thus we can drop compatibility with the old way of matching the disk via alias. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 13 +++---------- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_monitor.c | 6 ++---- src/qemu/qemu_monitor.h | 1 - src/qemu/qemu_monitor_json.c | 4 +--- src/qemu/qemu_monitor_json.h | 1 - src/qemu/qemu_process.c | 12 +++--------- tests/qemumonitorjsontest.c | 2 +- 8 files changed, 12 insertions(+), 31 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 430b75880b..56f4cd6197 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14914,8 +14914,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, virDomainDef *persistentDef =3D NULL; virDomainBlockIoTuneInfo info; virDomainBlockIoTuneInfo conf_info; - g_autofree char *drivealias =3D NULL; - const char *qdevid =3D NULL; int ret =3D -1; size_t i; virDomainDiskDef *conf_disk =3D NULL; @@ -15111,13 +15109,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, if (!qemuDomainDiskBlockIoTuneIsSupported(disk)) goto endjob; - if (QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName) { - qdevid =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName; - } else { - if (!(drivealias =3D qemuAliasDiskDriveFromDisk(disk))) - goto endjob; - } - cur_info =3D qemuDomainFindGroupBlockIoTune(def, disk, &info); if (qemuDomainSetBlockIoTuneDefaults(&info, cur_info, @@ -15167,7 +15158,9 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, int rc =3D 0; qemuDomainObjEnterMonitor(vm); - rc =3D qemuMonitorSetBlockIoThrottle(priv->mon, drivealias, qd= evid, &info); + rc =3D qemuMonitorSetBlockIoThrottle(priv->mon, + QEMU_DOMAIN_DISK_PRIVATE(di= sk)->qomName, + &info); qemuDomainObjExitMonitor(vm); if (rc < 0) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 972df572a7..806aecb29d 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -517,7 +517,7 @@ qemuDomainChangeMediaBlockdev(virDomainObj *vm, if (rc =3D=3D 0 && !virStorageSourceIsEmpty(newsrc) && qemuDiskConfigBlkdeviotuneEnabled(disk)) { - rc =3D qemuMonitorSetBlockIoThrottle(priv->mon, NULL, + rc =3D qemuMonitorSetBlockIoThrottle(priv->mon, diskPriv->qomName, &disk->blkdeviotune); } @@ -734,7 +734,7 @@ qemuDomainAttachDiskGeneric(virDomainObj *vm, g_autoptr(GHashTable) blockinfo =3D NULL; if (qemuDiskConfigBlkdeviotuneEnabled(disk)) { - if (qemuMonitorSetBlockIoThrottle(priv->mon, NULL, diskPriv->q= omName, + if (qemuMonitorSetBlockIoThrottle(priv->mon, diskPriv->qomName, &disk->blkdeviotune) < 0) VIR_WARN("failed to set blkdeviotune for '%s' of '%s'", di= sk->dst, vm->def->name); } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 5faf64a4ec..73a019e732 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2973,16 +2973,14 @@ qemuMonitorJobComplete(qemuMonitor *mon, int qemuMonitorSetBlockIoThrottle(qemuMonitor *mon, - const char *drivealias, const char *qomid, virDomainBlockIoTuneInfo *info) { - VIR_DEBUG("drivealias=3D%s, qomid=3D%s, info=3D%p", - NULLSTR(drivealias), NULLSTR(qomid), info); + VIR_DEBUG("qomid=3D%s, info=3D%p", NULLSTR(qomid), info); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONSetBlockIoThrottle(mon, drivealias, qomid, info); + return qemuMonitorJSONSetBlockIoThrottle(mon, qomid, info); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 6006a451a3..8f1bfc702a 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1052,7 +1052,6 @@ int qemuMonitorOpenGraphics(qemuMonitor *mon, bool skipauth); int qemuMonitorSetBlockIoThrottle(qemuMonitor *mon, - const char *drivealias, const char *qomid, virDomainBlockIoTuneInfo *info); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index af7649f8b0..360b6423cf 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4596,7 +4596,6 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_t= hrottle, #undef GET_THROTTLE_STATS_OPTIONAL int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon, - const char *drivealias, const char *qomid, virDomainBlockIoTuneInfo *info) { @@ -4604,8 +4603,7 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mo= n, g_autoptr(virJSONValue) result =3D NULL; if (!(cmd =3D qemuMonitorJSONMakeCommand("block_set_io_throttle", - "S:device", drivealias, - "S:id", qomid, + "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, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 3f77ab0ab3..802f6e7b44 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -401,7 +401,6 @@ qemuMonitorJSONOpenGraphics(qemuMonitor *mon, int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon, - const char *drivealias, const char *qomid, virDomainBlockIoTuneInfo *info); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 730e59eb7e..73cecde1f5 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7300,13 +7300,6 @@ qemuProcessSetupDiskThrottling(virDomainObj *vm, for (i =3D 0; i < vm->def->ndisks; i++) { virDomainDiskDef *disk =3D vm->def->disks[i]; - qemuDomainDiskPrivate *diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); - g_autofree char *drivealias =3D NULL; - - if (!QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName) { - if (!(drivealias =3D qemuAliasDiskDriveFromDisk(disk))) - goto cleanup; - } /* Setting throttling for empty drives fails */ if (virStorageSourceIsEmpty(disk->src)) @@ -7315,8 +7308,9 @@ qemuProcessSetupDiskThrottling(virDomainObj *vm, if (!qemuDiskConfigBlkdeviotuneEnabled(disk)) continue; - if (qemuMonitorSetBlockIoThrottle(qemuDomainGetMonitor(vm), drivea= lias, - diskPriv->qomName, &disk->blkdev= iotune) < 0) + if (qemuMonitorSetBlockIoThrottle(qemuDomainGetMonitor(vm), + QEMU_DOMAIN_DISK_PRIVATE(disk)->= qomName, + &disk->blkdeviotune) < 0) goto cleanup; } diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index ba12aae5b7..7e79b2e757 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1904,7 +1904,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(= const void *opaque) goto cleanup; if (qemuMonitorJSONSetBlockIoThrottle(qemuMonitorTestGetMonitor(test), - NULL, "drive-virtio-disk1", &inf= o) < 0) + "drive-virtio-disk1", &info) < 0) goto cleanup; ret =3D 0; --=20 2.40.1