From nobody Tue Feb 10 01:16:27 2026 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=1659971734; cv=none; d=zohomail.com; s=zohoarc; b=aVK11mfM/d49voGvTkM/1wgWao2FSWpL4lOxzkApw3DcHYsZcXm77ehMVWKaemRVwr8tzqUugLUjamxJfqZl+8vpUc2yOx78P9dV3/pPYUOy+PbNMqsE1uPYai57sD25zk8/T9Bjhxl/jJlj8uNhBn7jAgI/iBfFi7bV2KHkOEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659971734; h=Content-Type:Content-Transfer-Encoding:Cc: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=i2ODuyJiVZYmqqmUmhhro0POH8O38JWKRWqO1esLeWE=; b=Ac7ANgdxr6r1/ANQTqrwN0odPICVv9f0+o8980nZE1BE1KH7iXfgkvn2OJm9nn9fzH+uooPwQWu1Q9HBjRFLt0O71Q/CxbWaToBeIB0y9eQmqLcmUAJegvnMFyev1dig+G5Qcr3NiDAxH3K0uyKmdxIb8u5Ote1RkSZmBEzmgac= 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 1659971734219324.5675396390668; Mon, 8 Aug 2022 08:15:34 -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-187-fkhs8bofP-eV7r3m3XSzvA-1; Mon, 08 Aug 2022 11:15:29 -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 2770A805F47; Mon, 8 Aug 2022 15:15:26 +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 108811121315; Mon, 8 Aug 2022 15:15:26 +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 C67D41946A5B; Mon, 8 Aug 2022 15:15:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8922A1946A49 for ; Mon, 8 Aug 2022 15:15:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 57C272166B2E; Mon, 8 Aug 2022 15:15:16 +0000 (UTC) Received: from avogadro.lan (unknown [10.39.192.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C3832166B29; Mon, 8 Aug 2022 15:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659971733; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=i2ODuyJiVZYmqqmUmhhro0POH8O38JWKRWqO1esLeWE=; b=iBpfnxmv74GfMTpcQPPdvfXe9428e3JwpV7Sz5C0bBQhqcrd4gwiQIPTrdRBHtdqxz/7RG QtB4kvbKoV92RrgtoDhNy1CMKL+sAIns33QRV4KtqKviuEzBafpJSH3TzN5Bng9GnhOk4e T3US7AYBhjF63J5oJHPdwlxY/6E47co= X-MC-Unique: fkhs8bofP-eV7r3m3XSzvA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Paolo Bonzini To: libvir-list@redhat.com Subject: [PATCH v2 5/7] tests: remove query-cpus tests Date: Mon, 8 Aug 2022 17:15:06 +0200 Message-Id: <20220808151508.74044-6-pbonzini@redhat.com> In-Reply-To: <20220808151508.74044-1-pbonzini@redhat.com> References: <20220808151508.74044-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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: , Cc: pkrempa@redhat.com, phrdina@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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: 1659971736414100001 Content-Type: text/plain; charset="utf-8" All tests now use query-cpus-fast. Since the QEMU driver will lose support for query-cpus soon, go ahead and remove support for testing it. Signed-off-by: Paolo Bonzini --- tests/qemumonitorjsontest.c | 117 +++++------------------------------- 1 file changed, 15 insertions(+), 102 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 0001df7bb3..9d8a315103 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1291,7 +1291,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUsEqual(stru= ct qemuMonitorQueryCpusEntr static int testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test, struct qemuMonitorQueryC= pusEntry *expect, - bool fast, size_t num) { struct qemuMonitorQueryCpusEntry *cpudata =3D NULL; @@ -1300,7 +1299,7 @@ testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qem= uMonitorTest *test, int ret =3D -1; =20 if (qemuMonitorJSONQueryCPUs(qemuMonitorTestGetMonitor(test), - &cpudata, &ncpudata, true, fast) < 0) + &cpudata, &ncpudata, true, true) < 0) goto cleanup; =20 if (ncpudata !=3D num) { @@ -1326,72 +1325,6 @@ testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qe= muMonitorTest *test, } =20 =20 -static int -testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque) -{ - const testGenericData *data =3D opaque; - virDomainXMLOption *xmlopt =3D data->xmlopt; - struct qemuMonitorQueryCpusEntry expect_slow[] =3D { - {0, 17622, (char *) "/machine/unattached/device[0]", true}, - {1, 17624, (char *) "/machine/unattached/device[1]", true}, - {2, 17626, (char *) "/machine/unattached/device[2]", true}, - {3, 17628, NULL, true}, - }; - g_autoptr(qemuMonitorTest) test =3D NULL; - - if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) - return -1; - - qemuMonitorTestSkipDeprecatedValidation(test, true); - - if (qemuMonitorTestAddItem(test, "query-cpus", - "{" - " \"return\": [" - " {" - " \"current\": true," - " \"CPU\": 0," - " \"qom_path\": \"/machine/unatt= ached/device[0]\"," - " \"pc\": -2130530478," - " \"halted\": true," - " \"thread_id\": 17622" - " }," - " {" - " \"current\": false," - " \"CPU\": 1," - " \"qom_path\": \"/machine/unatt= ached/device[1]\"," - " \"pc\": -2130530478," - " \"halted\": true," - " \"thread_id\": 17624" - " }," - " {" - " \"current\": false," - " \"CPU\": 2," - " \"qom_path\": \"/machine/unatt= ached/device[2]\"," - " \"pc\": -2130530478," - " \"halted\": true," - " \"thread_id\": 17626" - " }," - " {" - " \"current\": false," - " \"CPU\": 3," - " \"pc\": -2130530478," - " \"halted\": true," - " \"thread_id\": 17628" - " }" - " ]," - " \"id\": \"libvirt-7\"" - "}") < 0) - return -1; - - /* query-cpus */ - if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_slo= w, - false, 4)) - return -1; - - return 0; -} - - static int testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque) { @@ -1425,8 +1358,7 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const= void *opaque) return -1; =20 /* query-cpus-fast */ - if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fas= t, - true, 2)) + if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fas= t, 2)) return -1; =20 return 0; @@ -2337,7 +2269,6 @@ struct testCPUInfoData { const char *name; size_t maxvcpus; virDomainXMLOption *xmlopt; - bool fast; GHashTable *schema; }; =20 @@ -2416,7 +2347,6 @@ testQemuMonitorCPUInfo(const void *opaque) g_autofree char *queryCpusStr =3D NULL; g_autofree char *queryHotpluggableStr =3D NULL; g_autofree char *actual =3D NULL; - const char *queryCpusFunction; qemuMonitorCPUInfo *vcpus =3D NULL; int rc; int ret =3D -1; @@ -2442,14 +2372,7 @@ testQemuMonitorCPUInfo(const void *opaque) queryHotpluggableStr) < 0) goto cleanup; =20 - if (data->fast) { - queryCpusFunction =3D "query-cpus-fast"; - } else { - queryCpusFunction =3D "query-cpus"; - qemuMonitorTestSkipDeprecatedValidation(test, true); - } - - if (qemuMonitorTestAddItem(test, queryCpusFunction, queryCpusStr) < 0) + if (qemuMonitorTestAddItem(test, "query-cpus-fast", queryCpusStr) < 0) goto cleanup; =20 vm =3D qemuMonitorTestGetDomainObj(test); @@ -2457,7 +2380,7 @@ testQemuMonitorCPUInfo(const void *opaque) goto cleanup; =20 rc =3D qemuMonitorGetCPUInfo(qemuMonitorTestGetMonitor(test), - &vcpus, data->maxvcpus, true, data->fast); + &vcpus, data->maxvcpus, true, true); =20 if (rc < 0) goto cleanup; @@ -3016,22 +2939,13 @@ mymain(void) =20 #define DO_TEST_CPU_INFO(name, maxvcpus) \ do { \ - struct testCPUInfoData data =3D {name, maxvcpus, driver.xmlopt, fa= lse, \ + struct testCPUInfoData data =3D {name, maxvcpus, driver.xmlopt, \ qapiData.schema}; \ if (virTestRun("GetCPUInfo(" name ")", testQemuMonitorCPUInfo, \ &data) < 0) \ ret =3D -1; \ } while (0) =20 -#define DO_TEST_CPU_INFO_FAST(name, maxvcpus) \ - do { \ - struct testCPUInfoData data =3D {name, maxvcpus, driver.xmlopt, tr= ue, \ - qapiData.schema }; \ - if (virTestRun("GetCPUInfo(" name ")", testQemuMonitorCPUInfo, \ - &data) < 0) \ - ret =3D -1; \ - } while (0) - DO_TEST(GetStatus); DO_TEST(GetVersion); DO_TEST(GetMachines); @@ -3103,7 +3017,6 @@ mymain(void) DO_TEST(qemuMonitorJSONSetBlockIoThrottle); DO_TEST(qemuMonitorJSONGetTargetArch); DO_TEST(qemuMonitorJSONGetMigrationCapabilities); - DO_TEST(qemuMonitorJSONQueryCPUs); DO_TEST(qemuMonitorJSONQueryCPUsFast); DO_TEST(qemuMonitorJSONSendKey); DO_TEST(qemuMonitorJSONGetDumpGuestMemoryCapability); @@ -3114,18 +3027,18 @@ mymain(void) DO_TEST_CPU_DATA("full"); DO_TEST_CPU_DATA("ecx"); =20 - DO_TEST_CPU_INFO_FAST("x86-basic-pluggable", 8); - DO_TEST_CPU_INFO_FAST("x86-full", 11); - DO_TEST_CPU_INFO_FAST("x86-node-full", 8); - DO_TEST_CPU_INFO_FAST("x86-dies", 16); + DO_TEST_CPU_INFO("x86-basic-pluggable", 8); + DO_TEST_CPU_INFO("x86-full", 11); + DO_TEST_CPU_INFO("x86-node-full", 8); + DO_TEST_CPU_INFO("x86-dies", 16); =20 - DO_TEST_CPU_INFO_FAST("ppc64-basic", 24); - DO_TEST_CPU_INFO_FAST("ppc64-hotplug-1", 24); - DO_TEST_CPU_INFO_FAST("ppc64-hotplug-2", 24); - DO_TEST_CPU_INFO_FAST("ppc64-hotplug-4", 24); - DO_TEST_CPU_INFO_FAST("ppc64-no-threads", 16); + DO_TEST_CPU_INFO("ppc64-basic", 24); + DO_TEST_CPU_INFO("ppc64-hotplug-1", 24); + DO_TEST_CPU_INFO("ppc64-hotplug-2", 24); + DO_TEST_CPU_INFO("ppc64-hotplug-4", 24); + DO_TEST_CPU_INFO("ppc64-no-threads", 16); =20 - DO_TEST_CPU_INFO_FAST("s390", 2); + DO_TEST_CPU_INFO("s390", 2); =20 #define DO_TEST_BLOCK_NODE_DETECT(testname) \ do { \ --=20 2.37.1