From nobody Mon Feb 9 05:00:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1588186338; cv=none; d=zohomail.com; s=zohoarc; b=kPPlgahyhZ6z4U//rqMGSagdhz9Q6dbm0C2nyyNYDPttb2WjHP6mrsZoombJ5v8ti6ngxlzpkjIMGnXrWEX5vPVym8ivIDSnVFQRKIb1LDzwbrb7dUQ9huLl/+lzZsIgSGjS9B6VHlaVG/48Gw08Dc6nFtDqnhjRGorZ5bsoBuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588186338; 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=KGLdscKo112qaEU0B5NoSm41U/s6pQ7BHk7jrOvx/fs=; b=MmKM1kyfgbXuF78ne9mKUx7fsBEBJcDunFHgAUbb195oltYpfV/QbUDs18ZfLb7xhMMjG52pWemEN/WwTvoC15y1Tv1E950p/cBfVTJF1UqYEoG59MER29nrt6Ljg2a1+NqhSynFril8BQMcB6qKyi4oZwdoYLHub+z+G9kAZWM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1588186338994647.6656418930297; Wed, 29 Apr 2020 11:52:18 -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-486-nnvC75ZwPYWQBxSH1KXqJw-1; Wed, 29 Apr 2020 14:50:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 049EB19200C3; Wed, 29 Apr 2020 18:49:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D43B65D780; Wed, 29 Apr 2020 18:49:54 +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 965594E586; Wed, 29 Apr 2020 18:49:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03TInWr3001588 for ; Wed, 29 Apr 2020 14:49:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id C74825C241; Wed, 29 Apr 2020 18:49:32 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42E9F5C1BE for ; Wed, 29 Apr 2020 18:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588186337; 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=KGLdscKo112qaEU0B5NoSm41U/s6pQ7BHk7jrOvx/fs=; b=YMXWsUJJIAwfFukwpVkWDEy5+TTSNRLdt4CDrBfc3KEnvNzL09gbYCgZM1czKKP4OhgsXp H1BerURqzVnqJEd1LqUJhGCDPJdk2CLwMTKR00CpODAZkhPIT8RRRq4p/xca8af8Ob4QGt JGqUPpAwXh8D7MDK9tfmOX7ewsIDlFU= X-MC-Unique: nnvC75ZwPYWQBxSH1KXqJw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/15] testQemuMonitorJSONqemuMonitorJSONQueryCPUs: Split off test for query-cpus-fast Date: Wed, 29 Apr 2020 20:49:11 +0200 Message-Id: <06a91c5b1cbc034a18c0b11d5f4e69c050173423.1588185999.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Separate the test for the newer command into a new function. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemumonitorjsontest.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 33bad45b96..7e0ab4609c 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1435,10 +1435,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const vo= id *opaque) {2, 17626, (char *) "/machine/unattached/device[2]", true}, {3, 17628, NULL, true}, }; - struct qemuMonitorQueryCpusEntry expect_fast[] =3D { - {0, 17629, (char *) "/machine/unattached/device[0]", false}, - {1, 17630, (char *) "/machine/unattached/device[1]", false}, - }; g_autoptr(qemuMonitorTest) test =3D NULL; if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) @@ -1483,6 +1479,29 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const vo= id *opaque) "}") < 0) return -1; + /* query-cpus */ + if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_slo= w, + false, 4)) + return -1; + + return 0; +} + + +static int +testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque) +{ + const testGenericData *data =3D opaque; + virDomainXMLOptionPtr xmlopt =3D data->xmlopt; + struct qemuMonitorQueryCpusEntry expect_fast[] =3D { + {0, 17629, (char *) "/machine/unattached/device[0]", false}, + {1, 17630, (char *) "/machine/unattached/device[1]", false}, + }; + g_autoptr(qemuMonitorTest) test =3D NULL; + + if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) + return -1; + if (qemuMonitorTestAddItem(test, "query-cpus-fast", "{" " \"return\": [" @@ -1501,11 +1520,6 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const vo= id *opaque) "}") < 0) return -1; - /* query-cpus */ - if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_slo= w, - false, 4)) - return -1; - /* query-cpus-fast */ if (testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(test, expect_fas= t, true, 2)) @@ -3236,6 +3250,7 @@ mymain(void) DO_TEST(qemuMonitorJSONGetTargetArch); DO_TEST(qemuMonitorJSONGetMigrationCapabilities); DO_TEST(qemuMonitorJSONQueryCPUs); + DO_TEST(qemuMonitorJSONQueryCPUsFast); DO_TEST(qemuMonitorJSONGetVirtType); DO_TEST(qemuMonitorJSONSendKey); DO_TEST(qemuMonitorJSONGetDumpGuestMemoryCapability); --=20 2.26.2