From nobody Sat May 11 17:39:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1530101237121135.1916764170869; Wed, 27 Jun 2018 05:07:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2E47B67C; Wed, 27 Jun 2018 12:07:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 904D618E53; Wed, 27 Jun 2018 12:07:15 +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 D9FBB18037F0; Wed, 27 Jun 2018 12:07:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5RC71Gf021076 for ; Wed, 27 Jun 2018 08:07:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 52C321C596; Wed, 27 Jun 2018 12:07:01 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB74D7C33 for ; Wed, 27 Jun 2018 12:07:00 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 27 Jun 2018 14:06:40 +0200 Message-Id: <92c32e113fedb2cea7f89c4ce1ebd81162a350dd.1530101166.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] tests: qemumonitorjson: Add only required replies for blockstats test 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 27 Jun 2018 12:07:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo added 4 replies but only one was used. Additionally the comment stated that 7 replies are going to be added. Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 2eefd06b6e..7da362bbf3 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1772,11 +1772,7 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo(= const void *data) if (!test) return -1; - /* fill in seven times - we are gonna ask seven times later on */ - if (qemuMonitorTestAddItem(test, "query-blockstats", reply) < 0 || - qemuMonitorTestAddItem(test, "query-blockstats", reply) < 0 || - qemuMonitorTestAddItem(test, "query-blockstats", reply) < 0 || - qemuMonitorTestAddItem(test, "query-blockstats", reply) < 0) + if (qemuMonitorTestAddItem(test, "query-blockstats", reply) < 0) goto cleanup; #define CHECK0FULL(var, value, varformat, valformat) \ --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 11 17:39:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1530101230753665.5337499422695; Wed, 27 Jun 2018 05:07:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0323C46289; Wed, 27 Jun 2018 12:07:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AAB62309128B; Wed, 27 Jun 2018 12:07:08 +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 E9CFA18037ED; Wed, 27 Jun 2018 12:07:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5RC72hT021096 for ; Wed, 27 Jun 2018 08:07:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id E7EA97C33; Wed, 27 Jun 2018 12:07:01 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CEF81C5B6 for ; Wed, 27 Jun 2018 12:07:01 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 27 Jun 2018 14:06:41 +0200 Message-Id: <3a99faab61d5579909eb2c98eb7282371af5ae25.1530101166.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] tests: qemumonitorjson: Fix name and call apropriate API 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 27 Jun 2018 12:07:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Call the internal version of qemuMonitorGetAllBlockStatsInfo API and rename the test accordingly. Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 7da362bbf3..c85bcbfc3b 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1674,7 +1674,7 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const = void *data) } static int -testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo(const void *data) +testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo(const void *data) { virDomainXMLOptionPtr xmlopt =3D (virDomainXMLOptionPtr)data; qemuMonitorTestPtr test =3D qemuMonitorTestNewSimple(true, xmlopt); @@ -1772,6 +1772,9 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo(c= onst void *data) if (!test) return -1; + if (!(blockstats =3D virHashCreate(10, virHashValueFree))) + goto cleanup; + if (qemuMonitorTestAddItem(test, "query-blockstats", reply) < 0) goto cleanup; @@ -1805,13 +1808,13 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo= (const void *data) CHECK0FULL(wr_highest_offset, WR_HIGHEST_OFFSET, "%llu", "%llu") \ CHECK0FULL(wr_highest_offset_valid, WR_HIGHEST_OFFSET_VALID, "%d", "%d= ") - if (qemuMonitorGetAllBlockStatsInfo(qemuMonitorTestGetMonitor(test), - &blockstats, false) < 0) + if (qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorTestGetMonitor(test= ), + blockstats, false) < 0) goto cleanup; if (!blockstats) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - "qemuMonitorJSONGetBlockStatsInfo didn't return sta= ts"); + "qemuMonitorJSONGetAllBlockStatsInfo didn't return = stats"); goto cleanup; } @@ -2972,7 +2975,7 @@ mymain(void) DO_TEST_GEN(qemuMonitorJSONDetachCharDev); DO_TEST(qemuMonitorJSONGetBalloonInfo); DO_TEST(qemuMonitorJSONGetBlockInfo); - DO_TEST(qemuMonitorJSONGetBlockStatsInfo); + DO_TEST(qemuMonitorJSONGetAllBlockStatsInfo); DO_TEST(qemuMonitorJSONGetMigrationCacheSize); DO_TEST(qemuMonitorJSONGetMigrationStats); DO_TEST(qemuMonitorJSONGetChardevInfo); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list