From nobody Sun Feb 8 19:03:59 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=1657888328; cv=none; d=zohomail.com; s=zohoarc; b=ibBbFphcGXcYAnOTwtvYpCVIdP6j+94/Ky/kjfHmuKG/1kirnqZx0CVtiBC0ye2IX6m/UqGycr0DLeMsQ0GLmfA1EvS2T2XtQa0ZoAu9aHaPW88jGfzva1BVsWTQJSGtxoD/u4o//75fpg5wkItQmNLYtvxn3OCvJbnoH8Qcqyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657888328; 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=ICt7MPLTqATHjqFGv8rN7Q1t4zJ5NqN7jOSTsUMb7rk=; b=dvq4aV+gmKymYjvg+YsBpgvSkhAoigeDuswe4oJELTJkxYFr3ytE8mwA4biTly4FsIlaWItQmA75BwM8FQvn7n2F2RZYHaMHZC0g2YHIRu5dttH/SaTXT950G/dzJAcYYj3sXMAEQIQ3SkQSzihi7+kvyfwwmnDefCwwPfIs7IE= 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 1657888328615195.5520878735324; Fri, 15 Jul 2022 05:32:08 -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-270-NWFiT7SMOwm_Er3VJLld_g-1; Fri, 15 Jul 2022 08:31:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A953F85A585; Fri, 15 Jul 2022 12:31:55 +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 93F7E1121315; Fri, 15 Jul 2022 12:31:55 +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 4C2B719466DF; Fri, 15 Jul 2022 12:31:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 82FAD1947B8C for ; Fri, 15 Jul 2022 12:31:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6769118EBB; Fri, 15 Jul 2022 12:31:53 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id D919918EAA for ; Fri, 15 Jul 2022 12:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657888326; 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=ICt7MPLTqATHjqFGv8rN7Q1t4zJ5NqN7jOSTsUMb7rk=; b=Ok+xSpsd8qZVGl5FfvNEsoRkZdSrTP7X0GA6ktSL3adeiZpu1rp+5xFe64IsNOkN2Pa0vr n+hPu4TG8MBy4m8bIZiXLX9YE1skRabQI1XLCpYZZ3c1a4H8+iD7R+uuvBDhIgZavTaM1V LSMYwGunDZYyLkXoo7r4E9u3LcjN5mw= X-MC-Unique: NWFiT7SMOwm_Er3VJLld_g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/7] qemu: monitor: Remove unused migration property getters/setters Date: Fri, 15 Jul 2022 14:31:42 +0200 Message-Id: <6d276a1f2016fe3341a4e9c5b0b0faa84bcccdc8.1657888221.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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 2.78 on 10.11.54.3 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: 1657888330730100001 Content-Type: text/plain; charset="utf-8" The getters/setters for individual properties of migration speed/downtime/cache size are unused once we switched to setting them purely via migration parameters. Remove the unused helpers. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 55 --------------------- src/qemu/qemu_monitor.h | 11 ----- src/qemu/qemu_monitor_json.c | 96 ------------------------------------ src/qemu/qemu_monitor_json.h | 15 ------ tests/qemumonitorjsontest.c | 39 --------------- 5 files changed, 216 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index fda5d2f368..109107eaae 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2245,61 +2245,6 @@ qemuMonitorSetDBusVMStateIdList(qemuMonitor *mon, } -int -qemuMonitorSetMigrationSpeed(qemuMonitor *mon, - unsigned long bandwidth) -{ - VIR_DEBUG("bandwidth=3D%lu", bandwidth); - - QEMU_CHECK_MONITOR(mon); - - if (bandwidth > QEMU_DOMAIN_MIG_BANDWIDTH_MAX) { - virReportError(VIR_ERR_OVERFLOW, - _("bandwidth must be less than %llu"), - QEMU_DOMAIN_MIG_BANDWIDTH_MAX + 1ULL); - return -1; - } - - return qemuMonitorJSONSetMigrationSpeed(mon, bandwidth); -} - - -int -qemuMonitorSetMigrationDowntime(qemuMonitor *mon, - unsigned long long downtime) -{ - VIR_DEBUG("downtime=3D%llu", downtime); - - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONSetMigrationDowntime(mon, downtime); -} - - -int -qemuMonitorGetMigrationCacheSize(qemuMonitor *mon, - unsigned long long *cacheSize) -{ - VIR_DEBUG("cacheSize=3D%p", cacheSize); - - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONGetMigrationCacheSize(mon, cacheSize); -} - - -int -qemuMonitorSetMigrationCacheSize(qemuMonitor *mon, - unsigned long long cacheSize) -{ - VIR_DEBUG("cacheSize=3D%llu", cacheSize); - - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONSetMigrationCacheSize(mon, cacheSize); -} - - /** * qemuMonitorGetMigrationParams: * @mon: Pointer to the monitor object. diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 95267ec6c7..f7e01f71fe 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -770,17 +770,6 @@ int qemuMonitorSavePhysicalMemory(qemuMonitor *mon, int qemuMonitorSetDBusVMStateIdList(qemuMonitor *mon, GSList *list); -int qemuMonitorSetMigrationSpeed(qemuMonitor *mon, - unsigned long bandwidth); - -int qemuMonitorSetMigrationDowntime(qemuMonitor *mon, - unsigned long long downtime); - -int qemuMonitorGetMigrationCacheSize(qemuMonitor *mon, - unsigned long long *cacheSize); -int qemuMonitorSetMigrationCacheSize(qemuMonitor *mon, - unsigned long long cacheSize); - int qemuMonitorGetMigrationParams(qemuMonitor *mon, virJSONValue **params); int qemuMonitorSetMigrationParams(qemuMonitor *mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 80696de731..5e4a86e5ad 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3034,102 +3034,6 @@ qemuMonitorJSONSavePhysicalMemory(qemuMonitor *mon, } -int qemuMonitorJSONSetMigrationSpeed(qemuMonitor *mon, - unsigned long bandwidth) -{ - g_autoptr(virJSONValue) cmd =3D NULL; - g_autoptr(virJSONValue) reply =3D NULL; - - cmd =3D qemuMonitorJSONMakeCommand("migrate_set_speed", - "U:value", bandwidth * 1024ULL * 1024= ULL, - NULL); - if (!cmd) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - return -1; - - if (qemuMonitorJSONCheckError(cmd, reply) < 0) - return -1; - - return 0; -} - - -int qemuMonitorJSONSetMigrationDowntime(qemuMonitor *mon, - unsigned long long downtime) -{ - g_autoptr(virJSONValue) cmd =3D NULL; - g_autoptr(virJSONValue) reply =3D NULL; - - cmd =3D qemuMonitorJSONMakeCommand("migrate_set_downtime", - "d:value", downtime / 1000.0, - NULL); - if (!cmd) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - return -1; - - if (qemuMonitorJSONCheckError(cmd, reply) < 0) - return -1; - - return 0; -} - - -int -qemuMonitorJSONGetMigrationCacheSize(qemuMonitor *mon, - unsigned long long *cacheSize) -{ - g_autoptr(virJSONValue) cmd =3D NULL; - g_autoptr(virJSONValue) reply =3D NULL; - - *cacheSize =3D 0; - - cmd =3D qemuMonitorJSONMakeCommand("query-migrate-cache-size", NULL); - if (!cmd) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - return -1; - - if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_NUMBER) < 0) - return -1; - - if (virJSONValueObjectGetNumberUlong(reply, "return", cacheSize) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("invalid cache size in query-migrate-cache-size r= eply")); - return -1; - } - - return 0; -} - - -int -qemuMonitorJSONSetMigrationCacheSize(qemuMonitor *mon, - unsigned long long cacheSize) -{ - g_autoptr(virJSONValue) cmd =3D NULL; - g_autoptr(virJSONValue) reply =3D NULL; - - cmd =3D qemuMonitorJSONMakeCommand("migrate-set-cache-size", - "U:value", cacheSize, - NULL); - if (!cmd) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - return -1; - - if (qemuMonitorJSONCheckError(cmd, reply) < 0) - return -1; - - return 0; -} - - int qemuMonitorJSONGetMigrationParams(qemuMonitor *mon, virJSONValue **params) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index ad3853ae69..7006aa8c46 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -152,21 +152,6 @@ qemuMonitorJSONSavePhysicalMemory(qemuMonitor *mon, unsigned long long length, const char *path); -int -qemuMonitorJSONSetMigrationSpeed(qemuMonitor *mon, - unsigned long bandwidth); - -int -qemuMonitorJSONSetMigrationDowntime(qemuMonitor *mon, - unsigned long long downtime); - -int -qemuMonitorJSONGetMigrationCacheSize(qemuMonitor *mon, - unsigned long long *cacheSize); -int -qemuMonitorJSONSetMigrationCacheSize(qemuMonitor *mon, - unsigned long long cacheSize); - int qemuMonitorJSONGetMigrationParams(qemuMonitor *mon, virJSONValue **params); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index ca1b8c3000..692aa75791 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1203,8 +1203,6 @@ GEN_TEST_FUNC(qemuMonitorJSONEjectMedia, "hdc", true) GEN_TEST_FUNC(qemuMonitorJSONChangeMedia, "hdc", "/foo/bar", "formatstr") GEN_TEST_FUNC(qemuMonitorJSONSaveVirtualMemory, 0, 1024, "/foo/bar") GEN_TEST_FUNC(qemuMonitorJSONSavePhysicalMemory, 0, 1024, "/foo/bar") -GEN_TEST_FUNC(qemuMonitorJSONSetMigrationSpeed, 1024) -GEN_TEST_FUNC(qemuMonitorJSONSetMigrationDowntime, 1) GEN_TEST_FUNC(qemuMonitorJSONMigrate, QEMU_MONITOR_MIGRATE_BACKGROUND | QEMU_MONITOR_MIGRATE_NON_SHARED_DISK | QEMU_MONITOR_MIGRATE_NON_SHARED_INC, "tcp:localhost:12345") @@ -1714,40 +1712,6 @@ testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsIn= fo(const void *opaque) } -static int -testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSize(const void *opaque) -{ - const testGenericData *data =3D opaque; - virDomainXMLOption *xmlopt =3D data->xmlopt; - unsigned long long cacheSize; - g_autoptr(qemuMonitorTest) test =3D NULL; - - if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) - return -1; - - qemuMonitorTestSkipDeprecatedValidation(test, true); - - if (qemuMonitorTestAddItem(test, "query-migrate-cache-size", - "{" - " \"return\": 67108864," - " \"id\": \"libvirt-12\"" - "}") < 0) - return -1; - - if (qemuMonitorJSONGetMigrationCacheSize(qemuMonitorTestGetMonitor(tes= t), - &cacheSize) < 0) - return -1; - - if (cacheSize !=3D 67108864) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "Invalid cacheSize: %llu, expected 67108864", - cacheSize); - return -1; - } - - return 0; -} - static int testQemuMonitorJSONqemuMonitorJSONGetMigrationStats(const void *opaque) { @@ -3105,8 +3069,6 @@ mymain(void) DO_TEST_GEN_DEPRECATED(qemuMonitorJSONChangeMedia, true); DO_TEST_GEN(qemuMonitorJSONSaveVirtualMemory); DO_TEST_GEN(qemuMonitorJSONSavePhysicalMemory); - DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationSpeed, true); - DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationDowntime, true); DO_TEST_GEN(qemuMonitorJSONMigrate); DO_TEST_GEN(qemuMonitorJSONMigrateRecover); DO_TEST_SIMPLE("migrate-pause", qemuMonitorJSONMigratePause); @@ -3136,7 +3098,6 @@ mymain(void) DO_TEST(qemuMonitorJSONGetBalloonInfo); DO_TEST(qemuMonitorJSONGetBlockInfo); DO_TEST(qemuMonitorJSONGetAllBlockStatsInfo); - DO_TEST(qemuMonitorJSONGetMigrationCacheSize); DO_TEST(qemuMonitorJSONGetMigrationStats); DO_TEST(qemuMonitorJSONGetChardevInfo); DO_TEST(qemuMonitorJSONSetBlockIoThrottle); --=20 2.36.1