From nobody Sun Dec 22 02:03:43 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=1685027739; cv=none; d=zohomail.com; s=zohoarc; b=HjeriHWUqKXWUe8AZA60ai/+XwEzX/lZ0e3JtPDQN1/LKudMjPq8svnKzxSJRkxc+8GWz8n3bRXhLs1Sn2d46uFN8segtsKBzEe6hG1n0w38juXBpMSIk+gq8OevwviaSUO0+JA5lcZEbkvPkjdjFd1ERP/xolmjVh0FknFSi5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685027739; 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=BcpfNVmEuInAafOWct/AnFd9UDVATJaoisEG3aKJ0+M=; b=CriGOPtCJqz1NfWNiugL/WKgQgGBbIivZSFzqqXsUmFTQTnO6azifL5fezgMz/BCb4v+Vs28lzla6qKgDsE73Fi8kNq2RPf/gZHtt5daz7+bfdpWb0okZz2hnxA4pXyj16zpELzulbV1z88wdy/Hn3jtHZFgkW62lNsbxlZ6k6k= 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 1685027739601493.1015399776817; Thu, 25 May 2023 08:15:39 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-ocJe32KhOHKH7ysPL_znxw-1; Thu, 25 May 2023 11:15:32 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 217E2802A55; Thu, 25 May 2023 15:15:27 +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 0E331401024; Thu, 25 May 2023 15:15:27 +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 D3D3919465A4; Thu, 25 May 2023 15:15:26 +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 18F1319465B1 for ; Thu, 25 May 2023 15:14:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B3519482062; Thu, 25 May 2023 15:14:00 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D684482066 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=1685027738; 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=BcpfNVmEuInAafOWct/AnFd9UDVATJaoisEG3aKJ0+M=; b=BkaT4bGoieBQOt+18Sn3B87OzuhujXoRUrg/fIxA4pyX7gl0khb3LbYDt2AuibqYqpPPWz o8+wlwNCQFOE9axqhs9apV8pA+CqWyIQHKtmwcgO1QZyy18fQVOdEhQB0AJOQb+YcxG9R7 58vLbCxPx+gH8b9w0fK4uE9VKgo8+Ss= X-MC-Unique: ocJe32KhOHKH7ysPL_znxw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 16/18] qemuMonitorGetBlockIoThrottle: Drop 'diskalias' argument Date: Thu, 25 May 2023 17:13:43 +0200 Message-Id: <7f274dfde41ef7e825d4651b7dfda40726454afb.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.9 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: 1685027741792100005 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 | 10 +--------- src/qemu/qemu_monitor.c | 6 ++---- src/qemu/qemu_monitor.h | 1 - src/qemu/qemu_monitor_json.c | 10 ++++------ src/qemu/qemu_monitor_json.h | 1 - tests/qemumonitorjsontest.c | 2 +- 6 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d3b37486c3..430b75880b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15240,8 +15240,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, virDomainDef *def =3D NULL; virDomainDef *persistentDef =3D NULL; virDomainBlockIoTuneInfo reply =3D {0}; - g_autofree char *drivealias =3D NULL; - const char *qdevid =3D NULL; int ret =3D -1; int maxparams; @@ -15288,14 +15286,8 @@ qemuDomainGetBlockIoTune(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; - } qemuDomainObjEnterMonitor(vm); - rc =3D qemuMonitorGetBlockIoThrottle(priv->mon, drivealias, qdevid= , &reply); + rc =3D qemuMonitorGetBlockIoThrottle(priv->mon, QEMU_DOMAIN_DISK_P= RIVATE(disk)->qomName, &reply); qemuDomainObjExitMonitor(vm); if (rc < 0) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index dacf161971..5faf64a4ec 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2988,16 +2988,14 @@ qemuMonitorSetBlockIoThrottle(qemuMonitor *mon, int qemuMonitorGetBlockIoThrottle(qemuMonitor *mon, - const char *drivealias, const char *qdevid, virDomainBlockIoTuneInfo *reply) { - VIR_DEBUG("drivealias=3D%s, qdevid=3D%s, reply=3D%p", - NULLSTR(drivealias), NULLSTR(qdevid), reply); + VIR_DEBUG("qdevid=3D%s, reply=3D%p", NULLSTR(qdevid), reply); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONGetBlockIoThrottle(mon, drivealias, qdevid, repl= y); + return qemuMonitorJSONGetBlockIoThrottle(mon, qdevid, reply); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 09f22f2328..6006a451a3 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1057,7 +1057,6 @@ int qemuMonitorSetBlockIoThrottle(qemuMonitor *mon, virDomainBlockIoTuneInfo *info); int qemuMonitorGetBlockIoThrottle(qemuMonitor *mon, - const char *drivealias, const char *qdevid, virDomainBlockIoTuneInfo *reply); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 745d83e2b6..af7649f8b0 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4517,7 +4517,6 @@ int qemuMonitorJSONOpenGraphics(qemuMonitor *mon, } static int qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle, - const char *drivealias, const char *qdevid, virDomainBlockIoTuneInfo *reply) { @@ -4547,8 +4546,8 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_t= hrottle, return -1; } - if ((drivealias && current_drive && STRNEQ(current_drive, driveali= as)) || - (qdevid && current_qdev && STRNEQ(current_qdev, qdevid))) + if (STRNEQ_NULLABLE(current_qdev, qdevid) && + STRNEQ_NULLABLE(current_drive, qdevid)) continue; found =3D true; @@ -4587,7 +4586,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_t= hrottle, if (!found) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot find throttling info for device '%1$s'"), - drivealias ? drivealias : qdevid); + qdevid); return -1; } @@ -4640,7 +4639,6 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mo= n, } int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon, - const char *drivealias, const char *qdevid, virDomainBlockIoTuneInfo *reply) { @@ -4649,7 +4647,7 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mo= n, if (!(devices =3D qemuMonitorJSONQueryBlock(mon))) return -1; - return qemuMonitorJSONBlockIoThrottleInfo(devices, drivealias, qdevid,= reply); + return qemuMonitorJSONBlockIoThrottleInfo(devices, qdevid, reply); } int qemuMonitorJSONSystemWakeup(qemuMonitor *mon) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 6f376cf9b7..3f77ab0ab3 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -407,7 +407,6 @@ qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon, int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon, - const char *drivealias, const char *qdevid, virDomainBlockIoTuneInfo *reply); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 5c05669280..ba12aae5b7 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1897,7 +1897,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(= const void *opaque) return -1; if (qemuMonitorJSONGetBlockIoThrottle(qemuMonitorTestGetMonitor(test), - "drive-virtio-disk0", NULL, &inf= o) < 0) + "drive-virtio-disk0", &info) < 0) goto cleanup; if (testValidateGetBlockIoThrottle(&info, &expectedInfo) < 0) --=20 2.40.1