From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063371827601.2763945283829; Wed, 26 Jul 2017 03:02:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D0414A6EA; Wed, 26 Jul 2017 10:02:47 +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 D5CCA53C6D; Wed, 26 Jul 2017 10:02:46 +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 B3B7E14B26; Wed, 26 Jul 2017 10:02:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA0qD5008730 for ; Wed, 26 Jul 2017 06:00:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id EF2E16FE6F; Wed, 26 Jul 2017 10:00:52 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 467146FE6A; Wed, 26 Jul 2017 10:00:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0D0414A6EA Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:31 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 01/24] qemu: monitor: Extract call of 'query-blockstats' and add new API for it 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 26 Jul 2017 10:02:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow getting the raw data from query-blockstats, so that we can use it to detect the backing chain later on. --- src/qemu/qemu_monitor.c | 15 +++++++++++++++ src/qemu/qemu_monitor.h | 2 ++ src/qemu/qemu_monitor_json.c | 44 +++++++++++++++++++++++++++++-----------= ---- src/qemu/qemu_monitor_json.h | 2 ++ 4 files changed, 48 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 2b0afcc21..19082d8bf 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2242,6 +2242,21 @@ qemuMonitorGetBlockInfo(qemuMonitorPtr mon) /** + * qemuMonitorQueryBlockstats: + * @mon: monitor object + * + * Returns data from a call to 'query-blockstats'. + */ +virJSONValuePtr +qemuMonitorQueryBlockstats(qemuMonitorPtr mon) +{ + QEMU_CHECK_MONITOR_JSON_NULL(mon); + + return qemuMonitorJSONQueryBlockstats(mon); +} + + +/** * qemuMonitorGetAllBlockStatsInfo: * @mon: monitor object * @ret_stats: pointer that is filled with a hash table containing the sta= ts diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 1697db55c..31f7e97ba 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -523,6 +523,8 @@ int qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon, int qemuMonitorBlockIOStatusToError(const char *status); virHashTablePtr qemuMonitorGetBlockInfo(qemuMonitorPtr mon); +virJSONValuePtr qemuMonitorQueryBlockstats(qemuMonitorPtr mon); + typedef struct _qemuBlockStats qemuBlockStats; typedef qemuBlockStats *qemuBlockStatsPtr; struct _qemuBlockStats { diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 65b1fbb8e..b8a68154a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2061,34 +2061,49 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr= dev, } -int -qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, - virHashTablePtr hash, - bool backingChain) +virJSONValuePtr +qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon) { - int ret =3D -1; - int nstats =3D 0; - int rc; - size_t i; virJSONValuePtr cmd; virJSONValuePtr reply =3D NULL; - virJSONValuePtr devices; + virJSONValuePtr ret =3D NULL; if (!(cmd =3D qemuMonitorJSONMakeCommand("query-blockstats", NULL))) - return -1; + return NULL; - if ((rc =3D qemuMonitorJSONCommand(mon, cmd, &reply)) < 0) + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; if (qemuMonitorJSONCheckError(cmd, reply) < 0) goto cleanup; - if (!(devices =3D virJSONValueObjectGetArray(reply, "return"))) { + if (!(ret =3D virJSONValueObjectStealArray(reply, "return"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats reply was missing device list")); + _("query-blockstats reply was missing device list")= ); goto cleanup; } + cleanup: + virJSONValueFree(cmd); + virJSONValueFree(reply); + return ret; +} + + +int +qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, + virHashTablePtr hash, + bool backingChain) +{ + int ret =3D -1; + int nstats =3D 0; + int rc; + size_t i; + virJSONValuePtr devices; + + if (!(devices =3D qemuMonitorJSONQueryBlockstats(mon))) + return -1; + for (i =3D 0; i < virJSONValueArraySize(devices); i++) { virJSONValuePtr dev =3D virJSONValueArrayGet(devices, i); const char *dev_name; @@ -2120,8 +2135,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mo= n, ret =3D nstats; cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); + virJSONValueFree(devices); return ret; } diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index d090d5709..7462967b5 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -81,6 +81,8 @@ int qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitorPtr mo= n, int period); int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, virHashTablePtr table); + +virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon); int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, virHashTablePtr hash, bool backingChain); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063374448466.0997135917129; Wed, 26 Jul 2017 03:02:54 -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 44DA2A0B80; Wed, 26 Jul 2017 10:02:52 +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 1AB67779F6; Wed, 26 Jul 2017 10:02:52 +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 B9E6114B2A; Wed, 26 Jul 2017 10:02:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA0sAt008740 for ; Wed, 26 Jul 2017 06:00:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 767D66FE6A; Wed, 26 Jul 2017 10:00:54 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 494766FB61; Wed, 26 Jul 2017 10:00:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 44DA2A0B80 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:32 +0200 Message-Id: <9c320bc17be499eeddbffa9fa9513c2c232dcfc0.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 02/24] tests: qemumonitorjson: Consolidate basic node name detection test cases 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.27]); Wed, 26 Jul 2017 10:02:52 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Test cases named '1' and '2' differed only in the length of the backing chain, so remove test case '2' and rename test '1' to 'basic'. --- .../qemumonitorjson-nodename-2.json | 2270 ----------------= ---- .../qemumonitorjson-nodename-2.result | 60 - ...-1.json =3D> qemumonitorjson-nodename-basic.json} | 0 ...esult =3D> qemumonitorjson-nodename-basic.result} | 0 tests/qemumonitorjsontest.c | 3 +- 5 files changed, 1 insertion(+), 2332 deletions(-) delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-2.js= on delete mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-2.re= sult rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-1.json =3D> qem= umonitorjson-nodename-basic.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-1.result =3D> q= emumonitorjson-nodename-basic.result} (100%) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-2.json b/te= sts/qemumonitorjsondata/qemumonitorjson-nodename-2.json deleted file mode 100644 index 452b9d695..000000000 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-2.json +++ /dev/null @@ -1,2270 +0,0 @@ -[ - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block2399", - "backing_file_depth": 0, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.qcow2", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 9665380352, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "format": "file", - "actual-size": 9665384448, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block2281", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.qcow2", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block2157", - "backing_file_depth": 1, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.qcow2", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483536402", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 197120, - "filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "format": "file", - "actual-size": 200704, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block2008", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483536402", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14835364= 02", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1979", - "backing_file_depth": 2, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1483536402", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483545313", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 33161216, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "format": "file", - "actual-size": 33099776, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1814", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483545313", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.qcow= 2", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148353= 6402", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14835453= 13", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1799", - "backing_file_depth": 3, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1483545313", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483545901", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 197120, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "format": "file", - "actual-size": 200704, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1690", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483545901", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.qc= ow2", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.1483= 536402", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148353640= 2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148354= 5313", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14835459= 01", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1528", - "backing_file_depth": 4, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1483545901", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483546244", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 197120, - "filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "format": "file", - "actual-size": 200704, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1427", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483546244", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.= qcow2", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.qcow2= ", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14= 83536402", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483536= 402", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.1483= 545313", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148354531= 3", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148354= 5901", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 19472384, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14835462= 44", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1350", - "backing_file_depth": 5, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1483546244", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483605920", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 19529728, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "format": "file", - "actual-size": 19472384, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1204", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483605920", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483536402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.= 3.qcow2", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.qco= w2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.= 1483536402", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.14835= 36402", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14= 83545313", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483545= 313", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.1483= 545901", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148354590= 1", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 19472384, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148354= 6244", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 945245467, - "name": "1483615244", - "date-sec": 1483615244, - "date-nsec": 439285000, - "vm-clock-sec": 4, - "id": "1", - "vm-state-size": 7226413 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 7618560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14836059= 20", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1119", - "backing_file_depth": 6, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1483605920", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483605924", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 7798784, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "format": "file", - "actual-size": 7618560, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block1075", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483605924", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.148353640= 2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel= 7.3.qcow2", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.q= cow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.= 3.1483536402", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148= 3536402", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.= 1483545313", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.14835= 45313", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14= 83545901", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483545= 901", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 19472384, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.1483= 546244", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148354624= 4", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 945245467, - "name": "1483615244", - "date-sec": 1483615244, - "date-nsec": 439285000, - "vm-clock-sec": 4, - "id": "1", - "vm-state-size": 7226413 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 7618560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148360= 5920", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 159182365, - "name": "1483615264", - "date-sec": 1483615264, - "date-nsec": 325173000, - "vm-clock-sec": 8, - "id": "1", - "vm-state-size": 151985953 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483615252", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 163266560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14836059= 24", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block998", - "backing_file_depth": 7, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1483605924", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483615252", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 163446784, - "filename": "/var/lib/libvirt/images/rhel7.3.1483615252", - "format": "file", - "actual-size": 163266560, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block843", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1483615252", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qcow2= ", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483536= 402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rh= el7.3.qcow2", - "backing-filename": "/var/lib/libvirt/images/rhel7.3= .qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.148354531= 3", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel= 7.3.1483536402", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1= 483536402", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545901", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.= 3.1483545313", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148= 3545313", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.= 1483545901", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.14835= 45901", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 19472384, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14= 83546244", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483546= 244", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 945245467, - "name": "1483615244", - "date-sec": 1483615244, - "date-nsec": 439285000, - "vm-clock-sec": 4, - "id": "1", - "vm-state-size": 7226413 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 7618560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.1483= 605920", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148360592= 0", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 159182365, - "name": "1483615264", - "date-sec": 1483615264, - "date-nsec": 325173000, - "vm-clock-sec": 8, - "id": "1", - "vm-state-size": 151985953 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483615252", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 163266560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148360= 5924", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071872", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 4132864, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14836152= 52", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483615252", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block717", - "backing_file_depth": 8, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1483615252", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1484071872", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 4194304, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071872", - "format": "file", - "actual-size": 4132864, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block612", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1484071872", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.qco= w2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.14835= 36402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/= rhel7.3.qcow2", - "backing-filename": "/var/lib/libvirt/images/rhel7= .3.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545= 313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rh= el7.3.1483536402", - "backing-filename": "/var/lib/libvirt/images/rhel7.3= .1483536402", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.148354590= 1", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel= 7.3.1483545313", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1= 483545313", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483546244", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.= 3.1483545901", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148= 3545901", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 19472384, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.= 1483546244", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.14835= 46244", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 945245467, - "name": "1483615244", - "date-sec": 1483615244, - "date-nsec": 439285000, - "vm-clock-sec": 4, - "id": "1", - "vm-state-size": 7226413 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 7618560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14= 83605920", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483605= 920", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 159182365, - "name": "1483615264", - "date-sec": 1483615264, - "date-nsec": 325173000, - "vm-clock-sec": 8, - "id": "1", - "vm-state-size": 151985953 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483615252", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 163266560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.1483= 605924", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148360592= 4", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071872", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 4132864, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148361= 5252", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483615252", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071876", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14840718= 72", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1484071872", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block560", - "backing_file_depth": 9, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1484071872", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1484071876", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 197120, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071876", - "format": "file", - "actual-size": 200704, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block430", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1484071876", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.q= cow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.148= 3536402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/image= s/rhel7.3.qcow2", - "backing-filename": "/var/lib/libvirt/images/rhe= l7.3.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.14835= 45313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/= rhel7.3.1483536402", - "backing-filename": "/var/lib/libvirt/images/rhel7= .3.1483536402", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483545= 901", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rh= el7.3.1483545313", - "backing-filename": "/var/lib/libvirt/images/rhel7.3= .1483545313", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.148354624= 4", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel= 7.3.1483545901", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1= 483545901", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605920", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 19472384, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.= 3.1483546244", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148= 3546244", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 945245467, - "name": "1483615244", - "date-sec": 1483615244, - "date-nsec": 439285000, - "vm-clock-sec": 4, - "id": "1", - "vm-state-size": 7226413 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 7618560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.= 1483605920", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.14836= 05920", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 159182365, - "name": "1483615264", - "date-sec": 1483615264, - "date-nsec": 325173000, - "vm-clock-sec": 8, - "id": "1", - "vm-state-size": 151985953 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483615252", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 163266560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14= 83605924", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483605= 924", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071872", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 4132864, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.1483= 615252", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148361525= 2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071876", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148407= 1872", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1484071872", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071877", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 2560000, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14840718= 76", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1484071876", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block316", - "backing_file_depth": 10, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1484071876", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1484071877", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 2621440, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071877", - "format": "file", - "actual-size": 2560000, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": true, - "node-name": "#block248", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1484071877", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "backing-image": { - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3= .qcow2", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 9665384448, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": true, - "refcount-bits": 16, - "corrupt": false - } - }, - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1= 483536402", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/ima= ges/rhel7.3.qcow2", - "backing-filename": "/var/lib/libvirt/images/r= hel7.3.qcow2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.148= 3545313", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 33099776, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/image= s/rhel7.3.1483536402", - "backing-filename": "/var/lib/libvirt/images/rhe= l7.3.1483536402", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.14835= 45901", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/= rhel7.3.1483545313", - "backing-filename": "/var/lib/libvirt/images/rhel7= .3.1483545313", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483546= 244", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rh= el7.3.1483545901", - "backing-filename": "/var/lib/libvirt/images/rhel7.3= .1483545901", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.148360592= 0", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 19472384, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel= 7.3.1483546244", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1= 483546244", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 945245467, - "name": "1483615244", - "date-sec": 1483615244, - "date-nsec": 439285000, - "vm-clock-sec": 4, - "id": "1", - "vm-state-size": 7226413 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483605924", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 7618560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.= 3.1483605920", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148= 3605920", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "snapshots": [ - { - "vm-clock-nsec": 159182365, - "name": "1483615264", - "date-sec": 1483615264, - "date-nsec": 325173000, - "vm-clock-sec": 8, - "id": "1", - "vm-state-size": 151985953 - } - ], - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1483615252", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 163266560, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.= 1483605924", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.14836= 05924", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071872", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 4132864, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14= 83615252", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1483615= 252", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071876", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 200704, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.1484= 071872", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.148407187= 2", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071877", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 2560000, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.148407= 1876", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1484071876", - "dirty-flag": false - }, - "backing-filename-format": "qcow2", - "virtual-size": 9663676416, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071880", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 17440768, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "/var/lib/libvirt/images/rhel7.3.14840718= 77", - "backing-filename": "/var/lib/libvirt/images/rhel7.3.1484071877", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "#block161", - "backing_file_depth": 11, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "/var/lib/libvirt/images/rhel7.3.1484071877", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1484071880", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 17498112, - "filename": "/var/lib/libvirt/images/rhel7.3.1484071880", - "format": "file", - "actual-size": 17440768, - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "#block013", - "backing_file_depth": 0, - "drv": "file", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": false, - "writeback": true - }, - "file": "/var/lib/libvirt/images/rhel7.3.1484071880", - "encryption_key_missing": false - } -] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-2.result b/= tests/qemumonitorjsondata/qemumonitorjson-nodename-2.result deleted file mode 100644 index b6e1e2916..000000000 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-2.result +++ /dev/null @@ -1,60 +0,0 @@ -filename : '/var/lib/libvirt/images/rhel7.3.1484071880' -format node : '#block161' -storage node: '#block013' -backingfile : '/var/lib/libvirt/images/rhel7.3.1484071877' -backing ptr : '#block316' - filename : '/var/lib/libvirt/images/rhel7.3.1484071877' - format node : '#block316' - storage node: '#block248' - backingfile : '/var/lib/libvirt/images/rhel7.3.1484071876' - backing ptr : '#block560' - filename : '/var/lib/libvirt/images/rhel7.3.1484071876' - format node : '#block560' - storage node: '#block430' - backingfile : '/var/lib/libvirt/images/rhel7.3.1484071872' - backing ptr : '#block717' - filename : '/var/lib/libvirt/images/rhel7.3.1484071872' - format node : '#block717' - storage node: '#block612' - backingfile : '/var/lib/libvirt/images/rhel7.3.1483615252' - backing ptr : '#block998' - filename : '/var/lib/libvirt/images/rhel7.3.1483615252' - format node : '#block998' - storage node: '#block843' - backingfile : '/var/lib/libvirt/images/rhel7.3.1483605924' - backing ptr : '#block1119' - filename : '/var/lib/libvirt/images/rhel7.3.1483605924' - format node : '#block1119' - storage node: '#block1075' - backingfile : '/var/lib/libvirt/images/rhel7.3.1483605920' - backing ptr : '#block1350' - filename : '/var/lib/libvirt/images/rhel7.3.1483605920' - format node : '#block1350' - storage node: '#block1204' - backingfile : '/var/lib/libvirt/images/rhel7.3.1483546244' - backing ptr : '#block1528' - filename : '/var/lib/libvirt/images/rhel7.3.1483546244' - format node : '#block1528' - storage node: '#block1427' - backingfile : '/var/lib/libvirt/images/rhel7.3.1483545901' - backing ptr : '#block1799' - filename : '/var/lib/libvirt/images/rhel7.3.1483545901' - format node : '#block1799' - storage node: '#block1690' - backingfile : '/var/lib/libvirt/images/rhel7.3.1483545313' - backing ptr : '#block1979' - filename : '/var/lib/libvirt/images/rhel7.3.148354531= 3' - format node : '#block1979' - storage node: '#block1814' - backingfile : '/var/lib/libvirt/images/rhel7.3.148353640= 2' - backing ptr : '#block2157' - filename : '/var/lib/libvirt/images/rhel7.3.1483536= 402' - format node : '#block2157' - storage node: '#block2008' - backingfile : '/var/lib/libvirt/images/rhel7.3.qcow2' - backing ptr : '#block2399' - filename : '/var/lib/libvirt/images/rhel7.3.qcow2' - format node : '#block2399' - storage node: '#block2281' - backingfile : '' - backing ptr : '' diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-1.json b/te= sts/qemumonitorjsondata/qemumonitorjson-nodename-basic.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-1.json rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result b/= tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 243f76469..c343c0d38 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2942,8 +2942,7 @@ mymain(void) ret =3D -1; = \ } while (0) - DO_TEST_BLOCK_NODE_DETECT("1", "#block118"); - DO_TEST_BLOCK_NODE_DETECT("2", "#block161"); + DO_TEST_BLOCK_NODE_DETECT("basic", "#block118"); DO_TEST_BLOCK_NODE_DETECT("same-backing", "#block170,#block574"); DO_TEST_BLOCK_NODE_DETECT("relative", "#block153,#block1177"); DO_TEST_BLOCK_NODE_DETECT("gluster", "#block1008"); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063377123118.30028336664543; Wed, 26 Jul 2017 03:02:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45734C00F0AB; Wed, 26 Jul 2017 10:02:52 +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 0DC6A6889D; Wed, 26 Jul 2017 10:02:52 +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 B8FC0180597F; Wed, 26 Jul 2017 10:02:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA0tAc008746 for ; Wed, 26 Jul 2017 06:00:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7BE6F6FB65; Wed, 26 Jul 2017 10:00:55 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id C71CD51C89; Wed, 26 Jul 2017 10:00:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 45734C00F0AB Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:33 +0200 Message-Id: <66bf987a8f57c341c13f99c83ba3e10f650a8b87.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 03/24] tests: qemumonitor: Prepare for more test data in testBlockNodeNameDetect 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 26 Jul 2017 10:02:52 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Rename 'json' and related variables to 'nodeNameJson'. Also rename the test files along. This is a preparation for modifying how we detect node names which will require also data from 'query-blockstats'. --- ...emumonitorjson-nodename-basic-named-nodes.json} | 0 ...umonitorjson-nodename-gluster-named-nodes.json} | 0 ...monitorjson-nodename-relative-named-nodes.json} | 0 ...torjson-nodename-same-backing-named-nodes.json} | 0 tests/qemumonitorjsontest.c | 22 +++++++++++-------= ---- 5 files changed, 11 insertions(+), 11 deletions(-) rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-basic.json =3D>= qemumonitorjson-nodename-basic-named-nodes.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-gluster.json = =3D> qemumonitorjson-nodename-gluster-named-nodes.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-relative.json = =3D> qemumonitorjson-nodename-relative-named-nodes.json} (100%) rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-same-backing.js= on =3D> qemumonitorjson-nodename-same-backing-named-nodes.json} (100%) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.json = b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named-nodes.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.json rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named-no= des.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.jso= n b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-nodes.= json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.json rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-= nodes.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.js= on b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-named-node= s.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.json rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-named= -nodes.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backin= g.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-na= med-nodes.json similarity index 100% rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing= .json rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-n= amed-nodes.json diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index c343c0d38..5bab9f507 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2740,19 +2740,19 @@ static int testBlockNodeNameDetect(const void *opaque) { const struct testBlockNodeNameDetectData *data =3D opaque; - char *jsonFile =3D NULL; - char *jsonStr =3D NULL; + char *namedNodesFile =3D NULL; + char *namedNodesStr =3D NULL; char *resultFile =3D NULL; char *actual =3D NULL; char **nodenames =3D NULL; char **next; - virJSONValuePtr json =3D NULL; + virJSONValuePtr namedNodesJson =3D NULL; virHashTablePtr nodedata =3D NULL; virBuffer buf =3D VIR_BUFFER_INITIALIZER; int ret =3D -1; - if (virAsprintf(&jsonFile, - "%s/qemumonitorjsondata/qemumonitorjson-nodename-%s.js= on", + if (virAsprintf(&namedNodesFile, + "%s/qemumonitorjsondata/qemumonitorjson-nodename-%s-na= med-nodes.json", abs_srcdir, data->name) < 0 || virAsprintf(&resultFile, "%s/qemumonitorjsondata/qemumonitorjson-nodename-%s.re= sult", @@ -2762,13 +2762,13 @@ testBlockNodeNameDetect(const void *opaque) if (!(nodenames =3D virStringSplit(data->nodenames, ",", 0))) goto cleanup; - if (virTestLoadFile(jsonFile, &jsonStr) < 0) + if (virTestLoadFile(namedNodesFile, &namedNodesStr) < 0) goto cleanup; - if (!(json =3D virJSONValueFromString(jsonStr))) + if (!(namedNodesJson =3D virJSONValueFromString(namedNodesStr))) goto cleanup; - if (!(nodedata =3D qemuBlockNodeNameGetBackingChain(json))) + if (!(nodedata =3D qemuBlockNodeNameGetBackingChain(namedNodesJson))) goto cleanup; for (next =3D nodenames; *next; next++) @@ -2787,13 +2787,13 @@ testBlockNodeNameDetect(const void *opaque) ret =3D 0; cleanup: - VIR_FREE(jsonFile); + VIR_FREE(namedNodesFile); VIR_FREE(resultFile); - VIR_FREE(jsonStr); + VIR_FREE(namedNodesStr); VIR_FREE(actual); virHashFree(nodedata); virStringListFree(nodenames); - virJSONValueFree(json); + virJSONValueFree(namedNodesJson); return ret; } --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063383258807.4201973797626; Wed, 26 Jul 2017 03:03:03 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50EC27F7A2; Wed, 26 Jul 2017 10:03:00 +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 25EE053CCA; Wed, 26 Jul 2017 10:03:00 +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 C64AD180BA88; Wed, 26 Jul 2017 10:02:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA0u87008754 for ; Wed, 26 Jul 2017 06:00:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 77A576FE6A; Wed, 26 Jul 2017 10:00:56 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8DBB51C89; Wed, 26 Jul 2017 10:00:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 50EC27F7A2 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:34 +0200 Message-Id: <03ef08379ad5589ba921996436c72ecdd3119ed5.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 04/24] tests: qemumonitorjson: Drop redundant data from testBlockNodeNameDetectFormat 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 26 Jul 2017 10:03:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The node name and backing file name can be inferred from the hierarchy. This will also help when converting to detect node names using query-blockstats data. --- .../qemumonitorjson-nodename-basic.result | 6 ------ .../qemumonitorjson-nodename-gluster.result | 4 ---- .../qemumonitorjson-nodename-relative.result | 12 --------= ---- .../qemumonitorjson-nodename-same-backing.result | 4 ---- tests/qemumonitorjsontest.c | 4 ---- 5 files changed, 30 deletions(-) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.resul= t b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result index e43f3d366..992fc5165 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result @@ -1,15 +1,9 @@ filename : '/var/lib/libvirt/images/rhel7.3.1483545313' format node : '#block118' storage node: '#block078' -backingfile : '/var/lib/libvirt/images/rhel7.3.1483536402' -backing ptr : '#block331' filename : '/var/lib/libvirt/images/rhel7.3.1483536402' format node : '#block331' storage node: '#block281' - backingfile : '/var/lib/libvirt/images/rhel7.3.qcow2' - backing ptr : '#block567' filename : '/var/lib/libvirt/images/rhel7.3.qcow2' format node : '#block567' storage node: '#block424' - backingfile : '' - backing ptr : '' diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.res= ult b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result index f38798d4b..d99576202 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result @@ -1,10 +1,6 @@ filename : 'gluster://gluster-host/vol0/img1' format node : '#block1008' storage node: '#block981' -backingfile : 'gluster://gluster-host/vol0/img0' -backing ptr : '#block349' filename : 'gluster://gluster-host/vol0/img0' format node : '#block349' storage node: '#block269' - backingfile : '' - backing ptr : '' diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.re= sult b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.result index 2cd908786..27d9652c6 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.result @@ -1,31 +1,19 @@ filename : '/var/lib/libvirt/images/img3' format node : '#block153' storage node: '#block076' -backingfile : '/var/lib/libvirt/images/img2' -backing ptr : '#block357' filename : '/var/lib/libvirt/images/img2' format node : '#block357' storage node: '#block290' - backingfile : '/var/lib/libvirt/images/img1' - backing ptr : '#block514' filename : '/var/lib/libvirt/images/img1' format node : '#block514' storage node: '#block481' - backingfile : '/var/lib/libvirt/images/img0' - backing ptr : '#block709' filename : '/var/lib/libvirt/images/img0' format node : '#block709' storage node: '#block665' - backingfile : '' - backing ptr : '' filename : '/var/lib/libvirt/images/relsnap.qcow2' format node : '#block1177' storage node: '#block1027' -backingfile : '/var/lib/libvirt/images/base.qcow2' -backing ptr : '#block957' filename : '/var/lib/libvirt/images/base.qcow2' format node : '#block957' storage node: '#block840' - backingfile : '' - backing ptr : '' diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backin= g.result b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.= result index 2c774be27..3ad8423a3 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.result @@ -1,11 +1,7 @@ filename : '/var/lib/libvirt/images/a.qcow2' format node : '#block170' storage node: '#block057' -backingfile : '/var/lib/libvirt/images/base.qcow2' -backing ptr : '' filename : '/var/lib/libvirt/images/b.qcow2' format node : '#block574' storage node: '#block405' -backingfile : '/var/lib/libvirt/images/base.qcow2' -backing ptr : '' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 5bab9f507..56a0a25e1 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2721,10 +2721,6 @@ testBlockNodeNameDetectFormat(virBufferPtr buf, NULLSTR(entry->nodeformat)); virBufferAsprintf(buf, "storage node: '%s'\n", NULLSTR(entry->nodestorage)); - virBufferAsprintf(buf, "backingfile : '%s'\n", - NULLSTR(entry->backingstore)); - virBufferAsprintf(buf, "backing ptr : '%s'\n", - NULLSTR(entry->nodebacking)); virBufferAdjustIndent(buf, 2); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063378908290.7457028599208; Wed, 26 Jul 2017 03:02:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FB6B3680F; Wed, 26 Jul 2017 10:02:56 +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 E20EE6442C; Wed, 26 Jul 2017 10:02:55 +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 8AA1714B2B; Wed, 26 Jul 2017 10:02:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA0v9r008764 for ; Wed, 26 Jul 2017 06:00:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id B8EC051C89; Wed, 26 Jul 2017 10:00:57 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA2076FE74; Wed, 26 Jul 2017 10:00:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0FB6B3680F Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:35 +0200 Message-Id: <4d2e0fd9fed41cfe407a200b3a7d3271417352f5.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 05/24] tests: utils: Don't calculate file size in virTestLoadFile 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 26 Jul 2017 10:02:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The callers don't use it so don't waste a strlen(). Also fix the comment for the function. --- tests/testutils.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index ed01136a0..7f1c4672b 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -289,9 +289,17 @@ virTestRun(const char *title, return ret; } -/* Allocate BUF to the size of FILE. Read FILE into buffer BUF. - Upon any failure, diagnose it and return -1, but don't bother trying - to preserve errno. Otherwise, return the number of bytes copied into BU= F. */ + +/** + * virTestLoadFile: + * @file: name of the file to load + * @buf: buffer to load the file into + * + * Allocates @buf to the size of FILE. Reads FILE into buffer BUF. + * Upon any failure, error is printed to stderr and -1 is returned. 'errno= ' is + * not preserved. On success 0 is returned. Caller is responsible for free= ing + * @buf. + */ int virTestLoadFile(const char *file, char **buf) { @@ -345,7 +353,7 @@ virTestLoadFile(const char *file, char **buf) } VIR_FORCE_FCLOSE(fp); - return strlen(*buf); + return 0; } #ifndef WIN32 --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063398407542.0458226030745; Wed, 26 Jul 2017 03:03:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88190356F0; Wed, 26 Jul 2017 10:03:15 +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 5F5BD53CCA; Wed, 26 Jul 2017 10:03: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 83FB514B34; Wed, 26 Jul 2017 10:03:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA0wQI008771 for ; Wed, 26 Jul 2017 06:00:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id B7AE551C89; Wed, 26 Jul 2017 10:00:58 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 120896FE6E; Wed, 26 Jul 2017 10:00:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 88190356F0 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:36 +0200 Message-Id: <26b537a9e8d2f7b8d1b1674a1b9450801483123f.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 06/24] util: buffer: Add virBufferStrcatVArgs 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 26 Jul 2017 10:03:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Split out the worker loop into a separate function and export it. --- src/libvirt_private.syms | 1 + src/util/virbuffer.c | 27 +++++++++++++++++++++------ src/util/virbuffer.h | 2 ++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fa2cd08fe..588b76b43 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1345,6 +1345,7 @@ virBufferFreeAndReset; virBufferGetIndent; virBufferSetIndent; virBufferStrcat; +virBufferStrcatVArgs; virBufferTrim; virBufferURIEncodeString; virBufferUse; diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index f07b119c0..28a291bb0 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -831,6 +831,26 @@ virBufferEscapeShell(virBufferPtr buf, const char *str) } /** + * virBufferStrcatVArgs: + * @buf: the buffer to append to + * @ap: variable argument structure + * + * See virBufferStrcat. + */ +void +virBufferStrcatVArgs(virBufferPtr buf, + va_list ap) +{ + char *str; + + if (buf->error) + return; + + while ((str =3D va_arg(ap, char *)) !=3D NULL) + virBufferAdd(buf, str, -1); +} + +/** * virBufferStrcat: * @buf: the buffer to append to * @...: the variable list of strings, the last argument must be NULL @@ -842,14 +862,9 @@ void virBufferStrcat(virBufferPtr buf, ...) { va_list ap; - char *str; - - if (buf->error) - return; va_start(ap, buf); - while ((str =3D va_arg(ap, char *)) !=3D NULL) - virBufferAdd(buf, str, -1); + virBufferStrcatVArgs(buf, ap); va_end(ap); } diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index 7a7014aa7..f34217968 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -80,6 +80,8 @@ void virBufferVasprintf(virBufferPtr buf, const char *for= mat, va_list ap) ATTRIBUTE_FMT_PRINTF(2, 0); void virBufferStrcat(virBufferPtr buf, ...) ATTRIBUTE_SENTINEL; +void virBufferStrcatVArgs(virBufferPtr buf, va_list ap); + void virBufferEscape(virBufferPtr buf, char escape, const char *toescape, const char *format, const char *str); void virBufferEscapeN(virBufferPtr buf, const char *format, --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063407574206.78028783383434; Wed, 26 Jul 2017 03:03:27 -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 40C74C058EDA; Wed, 26 Jul 2017 10:03:23 +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 1AD317ADAA; Wed, 26 Jul 2017 10:03:23 +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 43CD7180BA8D; Wed, 26 Jul 2017 10:03:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA0xPt008779 for ; Wed, 26 Jul 2017 06:00:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id B79F56FE6D; Wed, 26 Jul 2017 10:00:59 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 116666FE6A; Wed, 26 Jul 2017 10:00:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 40C74C058EDA Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:37 +0200 Message-Id: <84a83c4f323860920fcc9b993ee2c4bc3e992063.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 07/24] tests: utils: Add virTestLoadFilePath helper 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.32]); Wed, 26 Jul 2017 10:03:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This new helper loads and returns a file from 'abs_srcdir'. By using variable arguments for the function, it's not necessary to format the path separately in the test cases. --- tests/testutils.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/testutils.h | 2 ++ 2 files changed, 53 insertions(+) diff --git a/tests/testutils.c b/tests/testutils.c index 7f1c4672b..f193cdf8b 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -356,6 +356,57 @@ virTestLoadFile(const char *file, char **buf) return 0; } + +static char * +virTestLoadFileGetPath(const char *p, + va_list ap) +{ + virBuffer buf =3D VIR_BUFFER_INITIALIZER; + char *path =3D NULL; + + virBufferAddLit(&buf, abs_srcdir "/"); + + if (p) { + virBufferAdd(&buf, p, -1); + virBufferStrcatVArgs(&buf, ap); + } + + if (!(path =3D virBufferContentAndReset(&buf))) + VIR_TEST_VERBOSE("failed to format file path"); + + return path; +} + + +/** + * virTestLoadFilePath: + * @...: file name components. + * + * Constructs the test file path from variable arguments and loads the fil= e. + * 'abs_srcdir' is automatically prepended. + */ +char * +virTestLoadFilePath(const char *p, ...) +{ + char *path =3D NULL; + char *ret =3D NULL; + va_list ap; + + va_start(ap, p); + + if (!(path =3D virTestLoadFileGetPath(p, ap))) + goto cleanup; + + ignore_value(virTestLoadFile(path, &ret)); + + cleanup: + va_end(ap); + VIR_FREE(path); + + return ret; +} + + #ifndef WIN32 static void virTestCaptureProgramExecChild(const char *const argv[], diff --git a/tests/testutils.h b/tests/testutils.h index c7f02e468..98dfa990e 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -52,6 +52,8 @@ int virTestRun(const char *title, int (*body)(const void *data), const void *data); int virTestLoadFile(const char *file, char **buf); +char *virTestLoadFilePath(const char *p, ...) + ATTRIBUTE_SENTINEL; int virTestCaptureProgramOutput(const char *const argv[], char **buf, int = maxlen); void virTestClearCommandPath(char *cmdset); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063351986533.7950358342301; Wed, 26 Jul 2017 03:02:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 824FAC04D2BE; Wed, 26 Jul 2017 10:02:28 +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 626E568893; Wed, 26 Jul 2017 10:02:27 +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 7060C4BB79; Wed, 26 Jul 2017 10:02:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA10dd008789 for ; Wed, 26 Jul 2017 06:01:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4DC16FE6D; Wed, 26 Jul 2017 10:01:00 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1115B51C89; Wed, 26 Jul 2017 10:00:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 824FAC04D2BE Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:38 +0200 Message-Id: <1ad4a28e529579312eeccfd4bbdf9792e8302866.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 08/24] tests: qemuhelp: convert to virTestLoadFilePath 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 26 Jul 2017 10:02:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" As a sample usage of the new helper convert the calls in qemuhelptest to the new helper. --- tests/qemuhelptest.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 7485d2dcd..1a6e7092f 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -44,7 +44,6 @@ static void printMismatchedFlags(virQEMUCapsPtr got, static int testHelpStrParsing(const void *data) { const struct testInfo *info =3D data; - char *path =3D NULL; char *help =3D NULL; unsigned int version, kvm_version; bool is_kvm; @@ -53,10 +52,7 @@ static int testHelpStrParsing(const void *data) char *got =3D NULL; char *expected =3D NULL; - if (virAsprintf(&path, "%s/qemuhelpdata/%s", abs_srcdir, info->name) <= 0) - return -1; - - if (virTestLoadFile(path, &help) < 0) + if (!(help =3D virTestLoadFilePath("qemuhelpdata/", info->name, NULL))) goto cleanup; if (!(flags =3D virQEMUCapsNew())) @@ -76,13 +72,8 @@ static int testHelpStrParsing(const void *data) virQEMUCapsSet(flags, QEMU_CAPS_MONITOR_JSON); # endif - VIR_FREE(path); VIR_FREE(help); - if (virAsprintf(&path, "%s/qemuhelpdata/%s-device", abs_srcdir, - info->name) < 0) - goto cleanup; - - if (virTestLoadFile(path, &help) < 0) + if (!(help =3D virTestLoadFilePath("qemuhelpdata/", info->name, "-devi= ce", NULL))) goto cleanup; if (virQEMUCapsParseDeviceStr(flags, help) < 0) @@ -125,7 +116,6 @@ static int testHelpStrParsing(const void *data) ret =3D 0; cleanup: - VIR_FREE(path); VIR_FREE(help); virObjectUnref(flags); VIR_FREE(got); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15010633725321015.5170400151097; Wed, 26 Jul 2017 03:02:52 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6EDAB4A70C; Wed, 26 Jul 2017 10:02:47 +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 36F186FB61; Wed, 26 Jul 2017 10:02:47 +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 E37C614B28; Wed, 26 Jul 2017 10:02:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA121U008805 for ; Wed, 26 Jul 2017 06:01:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id F41EF6FE6A; Wed, 26 Jul 2017 10:01:02 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45DF06FE6D; Wed, 26 Jul 2017 10:01:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6EDAB4A70C Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:39 +0200 Message-Id: <61e5bf7a11dd34dbda8642741a65ec7e74fa8995.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 09/24] tests: utils: Add virTestLoadFileJSON helper 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 26 Jul 2017 10:02:48 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This new helper loads, parses and returns a JSON file from 'abs_srcdir' By using variable arguments for the function, it's not necessary to format the path separately in the test cases. --- tests/testutils.c | 34 ++++++++++++++++++++++++++++++++++ tests/testutils.h | 4 ++++ 2 files changed, 38 insertions(+) diff --git a/tests/testutils.c b/tests/testutils.c index f193cdf8b..75f69e1c3 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -407,6 +407,40 @@ virTestLoadFilePath(const char *p, ...) } +/** + * virTestLoadFileJSON: + * @...: name components + * + * Constructs the test file path from variable arguments and loads and par= ses + * the JSON file. 'abs_srcdir' is automatically prepended to the path. + */ +virJSONValuePtr +virTestLoadFileJSON(const char *p, ...) +{ + virJSONValuePtr ret =3D NULL; + char *jsonstr =3D NULL; + char *path =3D NULL; + va_list ap; + + va_start(ap, p); + + if (!(path =3D virTestLoadFileGetPath(p, ap))) + goto cleanup; + + if (virTestLoadFile(path, &jsonstr) < 0) + goto cleanup; + + if (!(ret =3D virJSONValueFromString(jsonstr))) + VIR_TEST_VERBOSE("failed to parse json from file '%s'", path); + + cleanup: + va_end(ap); + VIR_FREE(jsonstr); + VIR_FREE(path); + return ret; +} + + #ifndef WIN32 static void virTestCaptureProgramExecChild(const char *const argv[], diff --git a/tests/testutils.h b/tests/testutils.h index 98dfa990e..49649c4f5 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -27,6 +27,7 @@ # include "viralloc.h" # include "virfile.h" # include "virstring.h" +# include "virjson.h" # include "capabilities.h" # include "domain_conf.h" @@ -54,6 +55,9 @@ int virTestRun(const char *title, int virTestLoadFile(const char *file, char **buf); char *virTestLoadFilePath(const char *p, ...) ATTRIBUTE_SENTINEL; +virJSONValuePtr virTestLoadFileJSON(const char *p, ...) + ATTRIBUTE_SENTINEL; + int virTestCaptureProgramOutput(const char *const argv[], char **buf, int = maxlen); void virTestClearCommandPath(char *cmdset); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063420525166.4428324220777; Wed, 26 Jul 2017 03:03:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99A797EA8A; Wed, 26 Jul 2017 10:03:37 +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 ED58577EE1; Wed, 26 Jul 2017 10:03:36 +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 361FA180BA97; Wed, 26 Jul 2017 10:03:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA13eF008815 for ; Wed, 26 Jul 2017 06:01:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4F48C6FE7B; Wed, 26 Jul 2017 10:01:03 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id A008B6FE76; Wed, 26 Jul 2017 10:01:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 99A797EA8A Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:40 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 10/24] tests: qemumonitorjson: simplify path handling in testBlockNodeNameDetect 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 26 Jul 2017 10:03:38 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Extract the test prefix path into a variable and reuse virTestLoadFileJSON to load the sample json files rather than doing it manually. --- tests/qemumonitorjsontest.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 56a0a25e1..268c15f4b 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2736,8 +2736,7 @@ static int testBlockNodeNameDetect(const void *opaque) { const struct testBlockNodeNameDetectData *data =3D opaque; - char *namedNodesFile =3D NULL; - char *namedNodesStr =3D NULL; + const char *pathprefix =3D "qemumonitorjsondata/qemumonitorjson-nodena= me-"; char *resultFile =3D NULL; char *actual =3D NULL; char **nodenames =3D NULL; @@ -2747,21 +2746,15 @@ testBlockNodeNameDetect(const void *opaque) virBuffer buf =3D VIR_BUFFER_INITIALIZER; int ret =3D -1; - if (virAsprintf(&namedNodesFile, - "%s/qemumonitorjsondata/qemumonitorjson-nodename-%s-na= med-nodes.json", - abs_srcdir, data->name) < 0 || - virAsprintf(&resultFile, - "%s/qemumonitorjsondata/qemumonitorjson-nodename-%s.re= sult", - abs_srcdir, data->name) < 0) + if (virAsprintf(&resultFile, "%s/%s%s.result", + abs_srcdir, pathprefix, data->name) < 0) goto cleanup; if (!(nodenames =3D virStringSplit(data->nodenames, ",", 0))) goto cleanup; - if (virTestLoadFile(namedNodesFile, &namedNodesStr) < 0) - goto cleanup; - - if (!(namedNodesJson =3D virJSONValueFromString(namedNodesStr))) + if (!(namedNodesJson =3D virTestLoadFileJSON(pathprefix, data->name, + "-named-nodes.json", NULL))) goto cleanup; if (!(nodedata =3D qemuBlockNodeNameGetBackingChain(namedNodesJson))) @@ -2783,9 +2776,7 @@ testBlockNodeNameDetect(const void *opaque) ret =3D 0; cleanup: - VIR_FREE(namedNodesFile); VIR_FREE(resultFile); - VIR_FREE(namedNodesStr); VIR_FREE(actual); virHashFree(nodedata); virStringListFree(nodenames); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063386458281.8872419330803; Wed, 26 Jul 2017 03:03:06 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 4DD1B883AB; Wed, 26 Jul 2017 10:03:01 +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 1605D6FE7A; Wed, 26 Jul 2017 10:03:01 +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 3CBE014B2E; Wed, 26 Jul 2017 10:03:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA16k8008856 for ; Wed, 26 Jul 2017 06:01:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 10DE06FB65; Wed, 26 Jul 2017 10:01:06 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 609B86FB61; Wed, 26 Jul 2017 10:01:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4DD1B883AB Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:41 +0200 Message-Id: <3530262c60cb6d067746859c55e6ae4b947c5e35.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 11/24] tests: qemumontitorjson: temporarily disable node name detection tests 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 26 Jul 2017 10:03:02 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" To simplify the refactoring patches disable the tests. This will allow to add test data later. --- tests/qemumonitorjsontest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 268c15f4b..c3e86419d 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2930,9 +2930,9 @@ mymain(void) } while (0) DO_TEST_BLOCK_NODE_DETECT("basic", "#block118"); - DO_TEST_BLOCK_NODE_DETECT("same-backing", "#block170,#block574"); - DO_TEST_BLOCK_NODE_DETECT("relative", "#block153,#block1177"); - DO_TEST_BLOCK_NODE_DETECT("gluster", "#block1008"); +/* DO_TEST_BLOCK_NODE_DETECT("same-backing", "#block170,#block574"); */ +/* DO_TEST_BLOCK_NODE_DETECT("relative", "#block153,#block1177"); */ +/* DO_TEST_BLOCK_NODE_DETECT("gluster", "#block1008"); */ #undef DO_TEST_BLOCK_NODE_DETECT --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063376699188.2039572264457; Wed, 26 Jul 2017 03:02:56 -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 3DC0F8B13C; Wed, 26 Jul 2017 10:02:52 +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 0D76E757BD; Wed, 26 Jul 2017 10:02:52 +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 B70CD180597E; Wed, 26 Jul 2017 10:02:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA17lh008866 for ; Wed, 26 Jul 2017 06:01:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 15B886FE76; Wed, 26 Jul 2017 10:01:07 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 682876FE6F; Wed, 26 Jul 2017 10:01:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3DC0F8B13C Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:42 +0200 Message-Id: <2fd7c56a868d7af8ce77de72a288abc5ec2c34bf.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 12/24] qemu: block: Rename qemuBlockFillNodeData and move it to the top 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.28]); Wed, 26 Jul 2017 10:02:52 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The same operation will become useful in other places so rename the function to be more generic and move it to the top so that it can be reused earlier in the file. --- src/qemu/qemu_block.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 22de70657..3afcbde94 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -27,6 +27,24 @@ #define VIR_FROM_THIS VIR_FROM_QEMU +static int +qemuBlockNamedNodesArrayToHash(size_t pos ATTRIBUTE_UNUSED, + virJSONValuePtr item, + void *opaque) +{ + virHashTablePtr table =3D opaque; + const char *name; + + if (!(name =3D virJSONValueObjectGetString(item, "node-name"))) + return 1; + + if (virHashAddEntry(table, name, item) < 0) + return -1; + + return 0; +} + + static void qemuBlockNodeNameBackingChainDataFree(qemuBlockNodeNameBackingChainDataPtr= data) { @@ -384,24 +402,6 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, } -static int -qemuBlockFillNodeData(size_t pos ATTRIBUTE_UNUSED, - virJSONValuePtr item, - void *opaque) -{ - virHashTablePtr table =3D opaque; - const char *name; - - if (!(name =3D virJSONValueObjectGetString(item, "node-name"))) - return 1; - - if (virHashAddEntry(table, name, item) < 0) - return -1; - - return 0; -} - - /** * qemuBlockGetNodeData: * @data: JSON object returned from query-named-block-nodes @@ -419,7 +419,7 @@ qemuBlockGetNodeData(virJSONValuePtr data) if (!(ret =3D virHashCreate(50, virJSONValueHashFree))) return NULL; - if (virJSONValueArrayForeachSteal(data, qemuBlockFillNodeData, ret) < = 0) + if (virJSONValueArrayForeachSteal(data, qemuBlockNamedNodesArrayToHash= , ret) < 0) goto error; return ret; --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063379893711.2509631505271; Wed, 26 Jul 2017 03:02:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7BCDB83F42; Wed, 26 Jul 2017 10:02:56 +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 81E6568D50; Wed, 26 Jul 2017 10:02:55 +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 33966180BA80; Wed, 26 Jul 2017 10:02:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1AI1008881 for ; Wed, 26 Jul 2017 06:01:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 083C46FE7A; Wed, 26 Jul 2017 10:01:10 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5051A6FE76; Wed, 26 Jul 2017 10:01:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7BCDB83F42 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:43 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 13/24] util: storagefile: rename 'nodebacking' to 'nodestorage' in virStorageSource 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 26 Jul 2017 10:02:57 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Make it less confusing by naming the field which refers to the storage object as 'nodestorage'. --- src/qemu/qemu_block.c | 10 +++++----- src/qemu/qemu_driver.c | 10 +++++----- src/util/virstoragefile.c | 6 +++--- src/util/virstoragefile.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 3afcbde94..dc96a43e1 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -305,7 +305,7 @@ qemuBlockDiskClearDetectedNodes(virDomainDiskDefPtr dis= k) while (next) { VIR_FREE(next->nodeformat); - VIR_FREE(next->nodebacking); + VIR_FREE(next->nodestorage); next =3D next->backingStore; } @@ -321,22 +321,22 @@ qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk, virStorageSourcePtr src =3D disk->src; /* don't attempt the detection if the top level already has node names= */ - if (!parentnode || src->nodeformat || src->nodebacking) + if (!parentnode || src->nodeformat || src->nodestorage) return 0; while (src && parentnode) { if (!(entry =3D virHashLookup(table, parentnode))) break; - if (src->nodeformat || src->nodebacking) { + if (src->nodeformat || src->nodestorage) { if (STRNEQ_NULLABLE(src->nodeformat, entry->nodeformat) || - STRNEQ_NULLABLE(src->nodebacking, entry->nodestorage)) + STRNEQ_NULLABLE(src->nodestorage, entry->nodestorage)) goto error; break; } else { if (VIR_STRDUP(src->nodeformat, entry->nodeformat) < 0 || - VIR_STRDUP(src->nodebacking, entry->nodestorage) < 0) + VIR_STRDUP(src->nodestorage, entry->nodestorage) < 0) goto error; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9c54571cf..fe65b5776 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19492,8 +19492,8 @@ qemuDomainGetStatsOneBlockNode(virDomainStatsRecord= Ptr record, unsigned long long tmp; int ret =3D -1; - if (src->nodebacking && - (data =3D virHashLookup(nodedata, src->nodebacking))) { + if (src->nodestorage && + (data =3D virHashLookup(nodedata, src->nodestorage))) { if (virJSONValueObjectGetNumberUlong(data, "write_threshold", &tmp= ) =3D=3D 0 && tmp > 0) QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, @@ -20676,18 +20676,18 @@ qemuDomainSetBlockThreshold(virDomainPtr dom, if (!(src =3D qemuDomainGetStorageSourceByDevstr(dev, vm->def))) goto endjob; - if (!src->nodebacking && + if (!src->nodestorage && qemuBlockNodeNamesDetect(driver, vm, QEMU_ASYNC_JOB_NONE) < 0) goto endjob; - if (!src->nodebacking) { + if (!src->nodestorage) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("threshold currently can't be set for block devic= e '%s'"), dev); goto endjob; } - if (VIR_STRDUP(nodename, src->nodebacking) < 0) + if (VIR_STRDUP(nodename, src->nodestorage) < 0) goto endjob; qemuDomainObjEnterMonitor(driver, vm); diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 0add4c146..fbc8245f3 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2050,7 +2050,7 @@ virStorageSourceCopy(const virStorageSource *src, VIR_STRDUP(ret->snapshot, src->snapshot) < 0 || VIR_STRDUP(ret->configFile, src->configFile) < 0 || VIR_STRDUP(ret->nodeformat, src->nodeformat) < 0 || - VIR_STRDUP(ret->nodebacking, src->nodebacking) < 0 || + VIR_STRDUP(ret->nodestorage, src->nodestorage) < 0 || VIR_STRDUP(ret->compat, src->compat) < 0) goto error; @@ -2271,7 +2271,7 @@ virStorageSourceClear(virStorageSourcePtr def) virStorageNetHostDefFree(def->nhosts, def->hosts); virStorageAuthDefFree(def->auth); - VIR_FREE(def->nodebacking); + VIR_FREE(def->nodestorage); VIR_FREE(def->nodeformat); virStorageSourceBackingStoreClear(def); @@ -3941,7 +3941,7 @@ virStorageSourceFindByNodeName(virStorageSourcePtr to= p, for (tmp =3D top; tmp; tmp =3D tmp->backingStore) { if ((tmp->nodeformat && STREQ(tmp->nodeformat, nodeName)) || - (tmp->nodebacking && STREQ(tmp->nodebacking, nodeName))) + (tmp->nodestorage && STREQ(tmp->nodestorage, nodeName))) return tmp; if (idx) diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index d1e8ffe07..6c388b1a5 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -279,7 +279,7 @@ struct _virStorageSource { /* metadata that allows identifying given storage source */ char *nodeformat; /* name of the format handler object */ - char *nodebacking; /* name of the backing storage object */ + char *nodestorage; /* name of the storage object */ }; --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063414699845.0456780313702; Wed, 26 Jul 2017 03:03:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC7C885546; Wed, 26 Jul 2017 10:03:27 +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 97EC4756C0; Wed, 26 Jul 2017 10:03:27 +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 E1C1214B2E; Wed, 26 Jul 2017 10:03:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1Bdu008891 for ; Wed, 26 Jul 2017 06:01:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 012686FE6F; Wed, 26 Jul 2017 10:01:11 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50E536FE60; Wed, 26 Jul 2017 10:01:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CC7C885546 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:44 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 14/24] qemu: block: Refactor node name detection code 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 26 Jul 2017 10:03:28 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Remove the complex and unreliable code which inferred the node name hierarchy only from data returned by 'query-named-block-nodes'. It turns out that query-blockstats contain the full hierarchy of nodes as perceived by qemu so the inference code is not necessary. In query blockstats, the 'parent' object corresponds to the storage behind a storage volume and 'backing' corresponds to the lower level of backing chain. Since all have node names this data can be really easily used to detect node names. In addition to the code refactoring the one remaining test case needed to be fixed along. --- src/qemu/qemu_block.c | 290 ++++++++---------= ---- src/qemu/qemu_block.h | 10 +- .../qemumonitorjson-nodename-basic-blockstats.json | 166 ++++++++++++ ...qemumonitorjson-nodename-basic-named-nodes.json | 18 +- .../qemumonitorjson-nodename-basic.result | 12 +- tests/qemumonitorjsontest.c | 22 +- 6 files changed, 313 insertions(+), 205 deletions(-) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-basi= c-blockstats.json diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index dc96a43e1..bca6965fa 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -48,20 +48,15 @@ qemuBlockNamedNodesArrayToHash(size_t pos ATTRIBUTE_UNU= SED, static void qemuBlockNodeNameBackingChainDataFree(qemuBlockNodeNameBackingChainDataPtr= data) { - size_t i; - if (!data) return; - for (i =3D 0; i < data->nelems; i++) - virJSONValueFree(data->elems[i]); - VIR_FREE(data->nodeformat); VIR_FREE(data->nodestorage); - VIR_FREE(data->nodebacking); VIR_FREE(data->qemufilename); - VIR_FREE(data->backingstore); + + qemuBlockNodeNameBackingChainDataFree(data->backing); VIR_FREE(data); } @@ -75,55 +70,10 @@ qemuBlockNodeNameBackingChainDataHashEntryFree(void *op= aque, } -struct qemuBlockNodeNameGetBackingChainData { - virHashTablePtr table; - qemuBlockNodeNameBackingChainDataPtr *entries; - size_t nentries; -}; - - -static int -qemuBlockNodeNameDetectProcessByFilename(size_t pos ATTRIBUTE_UNUSED, - virJSONValuePtr item, - void *opaque) -{ - struct qemuBlockNodeNameGetBackingChainData *data =3D opaque; - qemuBlockNodeNameBackingChainDataPtr entry; - const char *file; - - if (!(file =3D virJSONValueObjectGetString(item, "file"))) - return 1; - - if (!(entry =3D virHashLookup(data->table, file))) { - if (VIR_ALLOC(entry) < 0) - return -1; - - if (VIR_APPEND_ELEMENT_COPY(data->entries, data->nentries, entry) = < 0) { - VIR_FREE(entry); - return -1; - } - - if (VIR_STRDUP(entry->qemufilename, file) < 0) - return -1; - - if (virHashAddEntry(data->table, file, entry) < 0) - return -1; - } - - if (VIR_APPEND_ELEMENT(entry->elems, entry->nelems, item) < 0) - return -1; - - return 0; -} - - -static const char *qemuBlockDriversFormat[] =3D { - "qcow2", "raw", "qcow", "luks", "qed", "bochs", "cloop", "dmg", "paral= lels", - "vdi", "vhdx", "vmdk", "vpc", "vvfat", NULL}; -static const char *qemuBlockDriversStorage[] =3D { - "file", "iscsi", "nbd", "host_cdrom", "host_device", "ftp", "ftps", - "gluster", "http", "https", "nfs", "rbd", "sheepdog", "ssh", "tftp", N= ULL}; - +/* list of driver names of layers that qemu automatically adds into the + * backing chain */ +static const char *qemuBlockDriversBlockjob[] =3D { + "mirror_top", "commit_top", NULL }; static bool qemuBlockDriverMatch(const char *drvname, @@ -140,86 +90,110 @@ qemuBlockDriverMatch(const char *drvname, } +struct qemuBlockNodeNameGetBackingChainData { + virHashTablePtr nodenamestable; + virHashTablePtr disks; +}; + + static int -qemuBlockNodeNameDetectProcessExtract(qemuBlockNodeNameBackingChainDataPtr= data) +qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr next, + virHashTablePtr nodenamestable, + qemuBlockNodeNameBackingChainDataP= tr *nodenamedata) { - const char *drv; - const char *nodename; - const char *backingstore; - size_t i; + qemuBlockNodeNameBackingChainDataPtr data =3D NULL; + qemuBlockNodeNameBackingChainDataPtr backingdata =3D NULL; + virJSONValuePtr backing =3D virJSONValueObjectGetObject(next, "backing= "); + virJSONValuePtr parent =3D virJSONValueObjectGetObject(next, "parent"); + virJSONValuePtr parentnodedata; + virJSONValuePtr nodedata; + const char *nodename =3D virJSONValueObjectGetString(next, "node-name"= ); + const char *drvname; + const char *parentnodename =3D NULL; + const char *filename =3D NULL; + int ret =3D -1; - /* Since the only way to construct the backing chain is to look up the= files - * by file name, if two disks share a backing image we can't know whic= h node - * belongs to which backing chain. Refuse to detect such chains. */ - if (data->nelems > 2) + if (!nodename) return 0; - for (i =3D 0; i < data->nelems; i++) { - drv =3D virJSONValueObjectGetString(data->elems[i], "drv"); - nodename =3D virJSONValueObjectGetString(data->elems[i], "node-nam= e"); - backingstore =3D virJSONValueObjectGetString(data->elems[i], "back= ing_file"); + if ((nodedata =3D virHashLookup(nodenamestable, nodename)) && + (drvname =3D virJSONValueObjectGetString(nodedata, "drv"))) { + + /* qemu 2.9 reports layers in the backing chain which don't corres= pond + * to files. skip them */ + if (qemuBlockDriverMatch(drvname, qemuBlockDriversBlockjob)) { + if (backing) { + return qemuBlockNodeNameGetBackingChainBacking(backing, + nodenamesta= ble, + nodenamedat= a); + } else { + return 0; + } + } + } - if (!drv || !nodename) - continue; + if (parent && + (parentnodename =3D virJSONValueObjectGetString(parent, "node-name= "))) { + if ((parentnodedata =3D virHashLookup(nodenamestable, parentnodena= me))) + filename =3D virJSONValueObjectGetString(parentnodedata, "file= "); + } - if (qemuBlockDriverMatch(drv, qemuBlockDriversFormat)) { - if (data->nodeformat) - continue; + if (VIR_ALLOC(data) < 0) + goto cleanup; - if (VIR_STRDUP(data->nodeformat, nodename) < 0) - return -1; + if (VIR_STRDUP(data->nodeformat, nodename) < 0 || + VIR_STRDUP(data->nodestorage, parentnodename) < 0 || + VIR_STRDUP(data->qemufilename, filename) < 0) + goto cleanup; - /* extract the backing store file name for the protocol layer = */ - if (VIR_STRDUP(data->backingstore, backingstore) < 0) - return -1; - } else if (qemuBlockDriverMatch(drv, qemuBlockDriversStorage)) { - if (data->nodestorage) - continue; + if (backing && + qemuBlockNodeNameGetBackingChainBacking(backing, nodenamestable, + &backingdata) < 0) + goto cleanup; - if (VIR_STRDUP(data->nodestorage, nodename) < 0) - return -1; - } - } + VIR_STEAL_PTR(data->backing, backingdata); + VIR_STEAL_PTR(*nodenamedata, data); - return 0; + ret =3D 0; + + cleanup: + qemuBlockNodeNameBackingChainDataFree(data); + return ret; } static int -qemuBlockNodeNameDetectProcessLinkBacking(qemuBlockNodeNameBackingChainDat= aPtr data, - virHashTablePtr table) +qemuBlockNodeNameGetBackingChainDisk(size_t pos ATTRIBUTE_UNUSED, + virJSONValuePtr item, + void *opaque) { - qemuBlockNodeNameBackingChainDataPtr backing; - - if (!data->backingstore) - return 0; - - if (!(backing =3D virHashLookup(table, data->backingstore))) - return 0; - - if (VIR_STRDUP(data->nodebacking, backing->nodeformat) < 0) - return -1; + struct qemuBlockNodeNameGetBackingChainData *data =3D opaque; + const char *device =3D virJSONValueObjectGetString(item, "device"); + qemuBlockNodeNameBackingChainDataPtr devicedata =3D NULL; + int ret =3D -1; - return 0; -} + if (qemuBlockNodeNameGetBackingChainBacking(item, data->nodenamestable, + &devicedata) < 0) + goto cleanup; + if (devicedata && + virHashAddEntry(data->disks, device, devicedata) < 0) + goto cleanup; -static void -qemuBlockNodeNameGetBackingChainDataClearLookup(qemuBlockNodeNameBackingCh= ainDataPtr data) -{ - size_t i; + devicedata =3D NULL; + ret =3D 1; /* we don't really want to steal @item */ - for (i =3D 0; i < data->nelems; i++) - virJSONValueFree(data->elems[i]); + cleanup: + qemuBlockNodeNameBackingChainDataFree(devicedata); - VIR_FREE(data->elems); - data->nelems =3D 0; + return ret; } /** * qemuBlockNodeNameGetBackingChain: - * @json: JSON array of data returned from 'query-named-block-nodes' + * @namednodes: JSON array of data returned from 'query-named-block-nodes' + * @blockstats: JSON array of data returned from 'query-blockstats' * * Tries to reconstruct the backing chain from @json to allow detection of * node names that were auto-assigned by qemu. This is a best-effort opera= tion @@ -230,69 +204,40 @@ qemuBlockNodeNameGetBackingChainDataClearLookup(qemuB= lockNodeNameBackingChainDat * Returns a hash table on success and NULL on failure. */ virHashTablePtr -qemuBlockNodeNameGetBackingChain(virJSONValuePtr json) +qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodes, + virJSONValuePtr blockstats) { struct qemuBlockNodeNameGetBackingChainData data; - virHashTablePtr nodetable =3D NULL; + virHashTablePtr namednodestable =3D NULL; + virHashTablePtr disks =3D NULL; virHashTablePtr ret =3D NULL; - size_t i; memset(&data, 0, sizeof(data)); - /* hash table keeps the entries accessible by the 'file' in qemu */ - if (!(data.table =3D virHashCreate(50, NULL))) + if (!(namednodestable =3D virHashCreate(50, virJSONValueHashFree))) goto cleanup; - /* first group the named entries by the 'file' field */ - if (virJSONValueArrayForeachSteal(json, - qemuBlockNodeNameDetectProcessByFile= name, - &data) < 0) + if (virJSONValueArrayForeachSteal(namednodes, + qemuBlockNamedNodesArrayToHash, + namednodestable) < 0) goto cleanup; - /* extract the node names for the format and storage layer */ - for (i =3D 0; i < data.nentries; i++) { - if (qemuBlockNodeNameDetectProcessExtract(data.entries[i]) < 0) - goto cleanup; - } - - /* extract the node name for the backing file */ - for (i =3D 0; i < data.nentries; i++) { - if (qemuBlockNodeNameDetectProcessLinkBacking(data.entries[i], - data.table) < 0) - goto cleanup; - } - - /* clear JSON data necessary only for the lookup procedure */ - for (i =3D 0; i < data.nentries; i++) - qemuBlockNodeNameGetBackingChainDataClearLookup(data.entries[i]); - - /* create hash table hashed by the format node name */ - if (!(nodetable =3D virHashCreate(50, - qemuBlockNodeNameBackingChainDataHashE= ntryFree))) + if (!(disks =3D virHashCreate(50, qemuBlockNodeNameBackingChainDataHas= hEntryFree))) goto cleanup; - /* fill the entries */ - for (i =3D 0; i < data.nentries; i++) { - if (!data.entries[i]->nodeformat) - continue; - - if (virHashAddEntry(nodetable, data.entries[i]->nodeformat, - data.entries[i]) < 0) - goto cleanup; + data.nodenamestable =3D namednodestable; + data.disks =3D disks; - /* hash table steals the entry and then frees it by itself */ - data.entries[i] =3D NULL; - } + if (virJSONValueArrayForeachSteal(blockstats, + qemuBlockNodeNameGetBackingChainDisk, + &data) < 0) + goto cleanup; - VIR_STEAL_PTR(ret, nodetable); + VIR_STEAL_PTR(ret, disks); cleanup: - virHashFree(data.table); - virHashFree(nodetable); - for (i =3D 0; i < data.nentries; i++) - qemuBlockNodeNameBackingChainDataFree(data.entries[i]); - - VIR_FREE(data.entries); + virHashFree(namednodestable); + virHashFree(disks); return ret; } @@ -314,20 +259,19 @@ qemuBlockDiskClearDetectedNodes(virDomainDiskDefPtr d= isk) static int qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk, - const char *parentnode, - virHashTablePtr table) + virHashTablePtr disktable) { qemuBlockNodeNameBackingChainDataPtr entry =3D NULL; virStorageSourcePtr src =3D disk->src; - /* don't attempt the detection if the top level already has node names= */ - if (!parentnode || src->nodeformat || src->nodestorage) + if (!(entry =3D virHashLookup(disktable, disk->info.alias))) return 0; - while (src && parentnode) { - if (!(entry =3D virHashLookup(table, parentnode))) - break; + /* don't attempt the detection if the top level already has node names= */ + if (src->nodeformat || src->nodestorage) + return 0; + while (src && entry) { if (src->nodeformat || src->nodestorage) { if (STRNEQ_NULLABLE(src->nodeformat, entry->nodeformat) || STRNEQ_NULLABLE(src->nodestorage, entry->nodestorage)) @@ -340,7 +284,7 @@ qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk, goto error; } - parentnode =3D entry->nodebacking; + entry =3D entry->backing; src =3D src->backingStore; } @@ -359,10 +303,9 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, { qemuDomainObjPrivatePtr priv =3D vm->privateData; virHashTablePtr disktable =3D NULL; - virHashTablePtr nodenametable =3D NULL; virJSONValuePtr data =3D NULL; + virJSONValuePtr blockstats =3D NULL; virDomainDiskDefPtr disk; - struct qemuDomainDiskInfo *info; size_t i; int ret =3D -1; @@ -372,22 +315,19 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; - disktable =3D qemuMonitorGetBlockInfo(qemuDomainGetMonitor(vm)); data =3D qemuMonitorQueryNamedBlockNodes(qemuDomainGetMonitor(vm)); + blockstats =3D qemuMonitorQueryBlockstats(qemuDomainGetMonitor(vm)); - if (qemuDomainObjExitMonitor(driver, vm) < 0 || !data || !disktable) + if (qemuDomainObjExitMonitor(driver, vm) < 0 || !data || !blockstats) goto cleanup; - if (!(nodenametable =3D qemuBlockNodeNameGetBackingChain(data))) + if (!(disktable =3D qemuBlockNodeNameGetBackingChain(data, blockstats)= )) goto cleanup; for (i =3D 0; i < vm->def->ndisks; i++) { disk =3D vm->def->disks[i]; - if (!(info =3D virHashLookup(disktable, disk->info.alias))) - continue; - - if (qemuBlockDiskDetectNodes(disk, info->nodename, nodenametable) = < 0) + if (qemuBlockDiskDetectNodes(disk, disktable) < 0) goto cleanup; } @@ -395,7 +335,7 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, cleanup: virJSONValueFree(data); - virHashFree(nodenametable); + virJSONValueFree(blockstats); virHashFree(disktable); return ret; diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 17dec799f..5d21057a7 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -31,19 +31,15 @@ typedef struct qemuBlockNodeNameBackingChainData qemuBl= ockNodeNameBackingChainDa typedef qemuBlockNodeNameBackingChainData *qemuBlockNodeNameBackingChainDa= taPtr; struct qemuBlockNodeNameBackingChainData { char *qemufilename; /* name of the image from qemu */ - char *backingstore; char *nodeformat; /* node name of the format layer */ char *nodestorage; /* node name of the storage backing the format nod= e */ - char *nodebacking; /* node name of the backing file format layer */ - - /* data necessary for detection of the node names from qemu */ - virJSONValuePtr *elems; - size_t nelems; + qemuBlockNodeNameBackingChainDataPtr backing; }; virHashTablePtr -qemuBlockNodeNameGetBackingChain(virJSONValuePtr data); +qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodesdata, + virJSONValuePtr blockstats); int qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-block= stats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-block= stats.json new file mode 100644 index 000000000..c3752b4cf --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-blockstats.j= son @@ -0,0 +1,166 @@ +[ + { + "device": "drive-virtio-disk0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 32899072, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block033" + }, + "stats": { + "flush_total_time_ns": 452246313, + "wr_highest_offset": 8072282112, + "wr_total_time_ns": 4803102521, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 8, + "wr_bytes": 6517248, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 11065169148, + "flush_operations": 10, + "wr_operations": 129, + "rd_merged": 77, + "rd_bytes": 76399104, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 22663656304, + "rd_operations": 4038, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block220" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block481" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block558" + }, + "node-name": "#block306" + }, + "node-name": "#block187" + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named= -nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-name= d-nodes.json index fe2f32176..ce8fdae70 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named-nodes.= json +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named-nodes.= json @@ -21,7 +21,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block567", + "node-name": "#block558", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, @@ -50,7 +50,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block424", + "node-name": "#block481", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -109,7 +109,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block331", + "node-name": "#block306", "backing_file_depth": 1, "drv": "qcow2", "iops": 0, @@ -139,7 +139,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block281", + "node-name": "#block220", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -202,7 +202,7 @@ "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", "cluster-size": 65536, "format": "qcow2", - "actual-size": 32968704, + "actual-size": 33165312, "format-specific": { "type": "qcow2", "data": { @@ -218,7 +218,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block118", + "node-name": "#block187", "backing_file_depth": 2, "drv": "qcow2", "iops": 0, @@ -240,15 +240,15 @@ "iops_rd": 0, "detect_zeroes": "off", "image": { - "virtual-size": 33030144, + "virtual-size": 33226752, "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", "format": "file", - "actual-size": 32968704, + "actual-size": 33165312, "dirty-flag": false }, "iops_wr": 0, "ro": false, - "node-name": "#block078", + "node-name": "#block033", "backing_file_depth": 0, "drv": "file", "iops": 0, diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.resul= t b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result index 992fc5165..09e0b36ac 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result @@ -1,9 +1,9 @@ filename : '/var/lib/libvirt/images/rhel7.3.1483545313' -format node : '#block118' -storage node: '#block078' +format node : '#block187' +storage node: '#block033' filename : '/var/lib/libvirt/images/rhel7.3.1483536402' - format node : '#block331' - storage node: '#block281' + format node : '#block306' + storage node: '#block220' filename : '/var/lib/libvirt/images/rhel7.3.qcow2' - format node : '#block567' - storage node: '#block424' + format node : '#block558' + storage node: '#block481' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index c3e86419d..cb7a7dbdb 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2704,18 +2704,17 @@ struct testBlockNodeNameDetectData { static void testBlockNodeNameDetectFormat(virBufferPtr buf, - const char *basenode, + const char *diskalias, virHashTablePtr nodedata) { qemuBlockNodeNameBackingChainDataPtr entry =3D NULL; - const char *node =3D basenode; virBufferSetIndent(buf, 0); - while (node) { - if (!(entry =3D virHashLookup(nodedata, node))) - break; + if (!(entry =3D virHashLookup(nodedata, diskalias))) + return; + while (entry) { virBufferAsprintf(buf, "filename : '%s'\n", entry->qemufilename= ); virBufferAsprintf(buf, "format node : '%s'\n", NULLSTR(entry->nodeformat)); @@ -2724,7 +2723,7 @@ testBlockNodeNameDetectFormat(virBufferPtr buf, virBufferAdjustIndent(buf, 2); - node =3D entry->nodebacking; + entry =3D entry->backing; } virBufferSetIndent(buf, 0); @@ -2742,6 +2741,7 @@ testBlockNodeNameDetect(const void *opaque) char **nodenames =3D NULL; char **next; virJSONValuePtr namedNodesJson =3D NULL; + virJSONValuePtr blockstatsJson =3D NULL; virHashTablePtr nodedata =3D NULL; virBuffer buf =3D VIR_BUFFER_INITIALIZER; int ret =3D -1; @@ -2757,7 +2757,12 @@ testBlockNodeNameDetect(const void *opaque) "-named-nodes.json", NULL))) goto cleanup; - if (!(nodedata =3D qemuBlockNodeNameGetBackingChain(namedNodesJson))) + if (!(blockstatsJson =3D virTestLoadFileJSON(pathprefix, data->name, + "-blockstats.json", NULL))) + goto cleanup; + + if (!(nodedata =3D qemuBlockNodeNameGetBackingChain(namedNodesJson, + blockstatsJson))) goto cleanup; for (next =3D nodenames; *next; next++) @@ -2781,6 +2786,7 @@ testBlockNodeNameDetect(const void *opaque) virHashFree(nodedata); virStringListFree(nodenames); virJSONValueFree(namedNodesJson); + virJSONValueFree(blockstatsJson); return ret; } @@ -2929,7 +2935,7 @@ mymain(void) ret =3D -1; = \ } while (0) - DO_TEST_BLOCK_NODE_DETECT("basic", "#block118"); + DO_TEST_BLOCK_NODE_DETECT("basic", "drive-virtio-disk0"); /* DO_TEST_BLOCK_NODE_DETECT("same-backing", "#block170,#block574"); */ /* DO_TEST_BLOCK_NODE_DETECT("relative", "#block153,#block1177"); */ /* DO_TEST_BLOCK_NODE_DETECT("gluster", "#block1008"); */ --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063426916380.0514670956736; Wed, 26 Jul 2017 03:03:46 -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 31A1D267C5; Wed, 26 Jul 2017 10:03:45 +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 0EFA8779EA; Wed, 26 Jul 2017 10:03:45 +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 43A44180BA88; Wed, 26 Jul 2017 10:03:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1CM5008898 for ; Wed, 26 Jul 2017 06:01:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id F2CD451C89; Wed, 26 Jul 2017 10:01:11 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 505076FE60; Wed, 26 Jul 2017 10:01:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 31A1D267C5 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:45 +0200 Message-Id: <7e53940f0221c293f57644af3b6ca3cc209701f1.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 15/24] tests: Extract mock library for making hash table deterministic 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.30]); Wed, 26 Jul 2017 10:03:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" virHashNew calls virRandomBits to initialize seed for the hashing function. If a test uses iteration through the hash table to produce results they may/will be non-deterministic. Extract the mock library which was used for mac address mapping to be universal. --- tests/Makefile.am | 17 +++++++++------= -- tests/{virmacmapmock.c =3D> virdeterministichashmock.c} | 0 tests/virmacmaptest.c | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) rename tests/{virmacmapmock.c =3D> virdeterministichashmock.c} (100%) diff --git a/tests/Makefile.am b/tests/Makefile.am index 5be81d221..a2a9ebec9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1198,22 +1198,23 @@ else ! WITH_NSS EXTRA_DIST +=3D nsstest.c nssmock.c nsslinktest.c endif ! WITH_NSS -if WITH_YAJL -virmacmapmock_la_SOURCES =3D \ - virmacmapmock.c -virmacmapmock_la_CFLAGS =3D $(AM_CFLAGS) -virmacmapmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virmacmapmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +virdeterministichashmock_la_SOURCES =3D \ + virdeterministichashmock.c +virdeterministichashmock_la_CFLAGS =3D $(AM_CFLAGS) +virdeterministichashmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +virdeterministichashmock_la_LIBADD =3D $(MOCKLIBS_LIBS) + +test_libraries +=3D virdeterministichashmock.la +if WITH_YAJL virmacmaptest_SOURCES =3D \ virmacmaptest.c testutils.h testutils.c virmacmaptest_CLFAGS =3D $(AM_CFLAGS) virmacmaptest_LDADD =3D $(LDADDS) -test_libraries +=3D virmacmapmock.la test_programs +=3D virmacmaptest else ! WITH_YAJL -EXTRA_DIST +=3D virmacmapmock.c virmacmaptest.c +EXTRA_DIST +=3D virmacmaptest.c endif ! WITH_YAJL virnetdevtest_SOURCES =3D \ diff --git a/tests/virmacmapmock.c b/tests/virdeterministichashmock.c similarity index 100% rename from tests/virmacmapmock.c rename to tests/virdeterministichashmock.c diff --git a/tests/virmacmaptest.c b/tests/virmacmaptest.c index 35e312771..0627fb37a 100644 --- a/tests/virmacmaptest.c +++ b/tests/virmacmaptest.c @@ -234,4 +234,4 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virmacmapmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdeterministichashmoc= k.so") --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063428318448.610656384325; Wed, 26 Jul 2017 03:03:48 -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 945A7A9657; Wed, 26 Jul 2017 10:03:45 +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 667ED5D978; Wed, 26 Jul 2017 10:03:45 +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 147C63889; Wed, 26 Jul 2017 10:03:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1Dth008906 for ; Wed, 26 Jul 2017 06:01:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id F0FFE6FE6D; Wed, 26 Jul 2017 10:01:12 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D9336FE60; Wed, 26 Jul 2017 10:01:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 945A7A9657 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:46 +0200 Message-Id: <883a34077a986bf10c87c0348b0e13a2bdf6d035.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 16/24] tests: qemumonitorjson: Simplify node name detection 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, 26 Jul 2017 10:03:46 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We can now iterate the hash table and print all detected backing chains. This simplifies calling of the test cases. --- .../qemumonitorjson-nodename-basic.result | 1 + tests/qemumonitorjsontest.c | 55 +++++++++---------= ---- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.resul= t b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result index 09e0b36ac..bc183f8b9 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result @@ -1,3 +1,4 @@ +drive-virtio-disk0 filename : '/var/lib/libvirt/images/rhel7.3.1483545313' format node : '#block187' storage node: '#block033' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index cb7a7dbdb..88169832e 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2696,23 +2696,19 @@ testQemuMonitorCPUInfo(const void *opaque) } -struct testBlockNodeNameDetectData { - const char *name; - const char *nodenames; -}; - - -static void -testBlockNodeNameDetectFormat(virBufferPtr buf, - const char *diskalias, - virHashTablePtr nodedata) +static int +testBlockNodeNameDetectFormat(void *payload, + const void *name, + void *opaque) { - qemuBlockNodeNameBackingChainDataPtr entry =3D NULL; + qemuBlockNodeNameBackingChainDataPtr entry =3D payload; + const char *diskalias =3D name; + virBufferPtr buf =3D opaque; virBufferSetIndent(buf, 0); - if (!(entry =3D virHashLookup(nodedata, diskalias))) - return; + virBufferAdd(buf, diskalias, -1); + virBufferAddLit(buf, "\n"); while (entry) { virBufferAsprintf(buf, "filename : '%s'\n", entry->qemufilename= ); @@ -2728,18 +2724,17 @@ testBlockNodeNameDetectFormat(virBufferPtr buf, virBufferSetIndent(buf, 0); virBufferAddLit(buf, "\n"); + return 0; } static int testBlockNodeNameDetect(const void *opaque) { - const struct testBlockNodeNameDetectData *data =3D opaque; + const char *testname =3D opaque; const char *pathprefix =3D "qemumonitorjsondata/qemumonitorjson-nodena= me-"; char *resultFile =3D NULL; char *actual =3D NULL; - char **nodenames =3D NULL; - char **next; virJSONValuePtr namedNodesJson =3D NULL; virJSONValuePtr blockstatsJson =3D NULL; virHashTablePtr nodedata =3D NULL; @@ -2747,17 +2742,14 @@ testBlockNodeNameDetect(const void *opaque) int ret =3D -1; if (virAsprintf(&resultFile, "%s/%s%s.result", - abs_srcdir, pathprefix, data->name) < 0) - goto cleanup; - - if (!(nodenames =3D virStringSplit(data->nodenames, ",", 0))) + abs_srcdir, pathprefix, testname) < 0) goto cleanup; - if (!(namedNodesJson =3D virTestLoadFileJSON(pathprefix, data->name, + if (!(namedNodesJson =3D virTestLoadFileJSON(pathprefix, testname, "-named-nodes.json", NULL))) goto cleanup; - if (!(blockstatsJson =3D virTestLoadFileJSON(pathprefix, data->name, + if (!(blockstatsJson =3D virTestLoadFileJSON(pathprefix, testname, "-blockstats.json", NULL))) goto cleanup; @@ -2765,8 +2757,7 @@ testBlockNodeNameDetect(const void *opaque) blockstatsJson))) goto cleanup; - for (next =3D nodenames; *next; next++) - testBlockNodeNameDetectFormat(&buf, *next, nodedata); + virHashForEach(nodedata, testBlockNodeNameDetectFormat, &buf); virBufferTrim(&buf, "\n", -1); @@ -2784,7 +2775,6 @@ testBlockNodeNameDetect(const void *opaque) VIR_FREE(resultFile); VIR_FREE(actual); virHashFree(nodedata); - virStringListFree(nodenames); virJSONValueFree(namedNodesJson); virJSONValueFree(blockstatsJson); @@ -2927,18 +2917,17 @@ mymain(void) DO_TEST_CPU_INFO("ppc64-hotplug-4", 24); DO_TEST_CPU_INFO("ppc64-no-threads", 16); -#define DO_TEST_BLOCK_NODE_DETECT(testname, testnodes) = \ +#define DO_TEST_BLOCK_NODE_DETECT(testname) = \ do { = \ - struct testBlockNodeNameDetectData testdata =3D {testname, testnod= es}; \ if (virTestRun("node-name-detect(" testname ")", = \ - testBlockNodeNameDetect, &testdata) < 0) = \ + testBlockNodeNameDetect, testname) < 0) = \ ret =3D -1; = \ } while (0) - DO_TEST_BLOCK_NODE_DETECT("basic", "drive-virtio-disk0"); -/* DO_TEST_BLOCK_NODE_DETECT("same-backing", "#block170,#block574"); */ -/* DO_TEST_BLOCK_NODE_DETECT("relative", "#block153,#block1177"); */ -/* DO_TEST_BLOCK_NODE_DETECT("gluster", "#block1008"); */ + DO_TEST_BLOCK_NODE_DETECT("basic"); +/* DO_TEST_BLOCK_NODE_DETECT("same-backing"); */ +/* DO_TEST_BLOCK_NODE_DETECT("relative"); */ +/* DO_TEST_BLOCK_NODE_DETECT("gluster"); */ #undef DO_TEST_BLOCK_NODE_DETECT @@ -2947,4 +2936,4 @@ mymain(void) return (ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; } -VIR_TEST_MAIN(mymain) +VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdeterministichashmoc= k.so") --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063442387801.2458232166929; Wed, 26 Jul 2017 03:04:02 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 77F596572F; Wed, 26 Jul 2017 10:03:57 +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 13DC66FE79; Wed, 26 Jul 2017 10:03:57 +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 C43351805981; Wed, 26 Jul 2017 10:03:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1D3Z008916 for ; Wed, 26 Jul 2017 06:01:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id EBA1E6FE76; Wed, 26 Jul 2017 10:01:13 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 494F86FE6A; Wed, 26 Jul 2017 10:01:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 77F596572F Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:47 +0200 Message-Id: <6086e81888b18103e1f3c0db4042a2803d02d029.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 17/24] qemu: block: store and test driver names for detected storage nodes 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 26 Jul 2017 10:03:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Store the 'drv' field both for the storage node and for the format node and format them in the test case. --- src/qemu/qemu_block.c | 14 ++++++++++= +--- src/qemu/qemu_block.h | 4 ++++ .../qemumonitorjson-nodename-basic.result | 6 ++++++ tests/qemumonitorjsontest.c | 2 ++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index bca6965fa..348961199 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -56,6 +56,9 @@ qemuBlockNodeNameBackingChainDataFree(qemuBlockNodeNameBa= ckingChainDataPtr data) VIR_FREE(data->qemufilename); + VIR_FREE(data->drvformat); + VIR_FREE(data->drvstorage); + qemuBlockNodeNameBackingChainDataFree(data->backing); VIR_FREE(data); @@ -108,7 +111,8 @@ qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr= next, virJSONValuePtr parentnodedata; virJSONValuePtr nodedata; const char *nodename =3D virJSONValueObjectGetString(next, "node-name"= ); - const char *drvname; + const char *drvname =3D NULL; + const char *drvparent =3D NULL; const char *parentnodename =3D NULL; const char *filename =3D NULL; int ret =3D -1; @@ -134,8 +138,10 @@ qemuBlockNodeNameGetBackingChainBacking(virJSONValuePt= r next, if (parent && (parentnodename =3D virJSONValueObjectGetString(parent, "node-name= "))) { - if ((parentnodedata =3D virHashLookup(nodenamestable, parentnodena= me))) + if ((parentnodedata =3D virHashLookup(nodenamestable, parentnodena= me))) { filename =3D virJSONValueObjectGetString(parentnodedata, "file= "); + drvparent =3D virJSONValueObjectGetString(parentnodedata, "drv= "); + } } if (VIR_ALLOC(data) < 0) @@ -143,7 +149,9 @@ qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr= next, if (VIR_STRDUP(data->nodeformat, nodename) < 0 || VIR_STRDUP(data->nodestorage, parentnodename) < 0 || - VIR_STRDUP(data->qemufilename, filename) < 0) + VIR_STRDUP(data->qemufilename, filename) < 0 || + VIR_STRDUP(data->drvformat, drvname) < 0 || + VIR_STRDUP(data->drvstorage, drvparent) < 0) goto cleanup; if (backing && diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 5d21057a7..c0ed43ec0 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -34,6 +34,10 @@ struct qemuBlockNodeNameBackingChainData { char *nodeformat; /* node name of the format layer */ char *nodestorage; /* node name of the storage backing the format nod= e */ + /* for testing purposes */ + char *drvformat; + char *drvstorage; + qemuBlockNodeNameBackingChainDataPtr backing; }; diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.resul= t b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result index bc183f8b9..ad8b9b46e 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result @@ -1,10 +1,16 @@ drive-virtio-disk0 filename : '/var/lib/libvirt/images/rhel7.3.1483545313' format node : '#block187' +format drv : 'qcow2' storage node: '#block033' +storage drv : 'file' filename : '/var/lib/libvirt/images/rhel7.3.1483536402' format node : '#block306' + format drv : 'qcow2' storage node: '#block220' + storage drv : 'file' filename : '/var/lib/libvirt/images/rhel7.3.qcow2' format node : '#block558' + format drv : 'qcow2' storage node: '#block481' + storage drv : 'file' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 88169832e..346d5c401 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2714,8 +2714,10 @@ testBlockNodeNameDetectFormat(void *payload, virBufferAsprintf(buf, "filename : '%s'\n", entry->qemufilename= ); virBufferAsprintf(buf, "format node : '%s'\n", NULLSTR(entry->nodeformat)); + virBufferAsprintf(buf, "format drv : '%s'\n", NULLSTR(entry->drvf= ormat)); virBufferAsprintf(buf, "storage node: '%s'\n", NULLSTR(entry->nodestorage)); + virBufferAsprintf(buf, "storage drv : '%s'\n", NULLSTR(entry->drvs= torage)); virBufferAdjustIndent(buf, 2); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063401330629.5891233509592; Wed, 26 Jul 2017 03:03:21 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 40BF4806BF; Wed, 26 Jul 2017 10:03:18 +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 0BFBF703BD; Wed, 26 Jul 2017 10:03:18 +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 3E67A180BA88; Wed, 26 Jul 2017 10:03:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1EHJ008923 for ; Wed, 26 Jul 2017 06:01:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id E76576FE6E; Wed, 26 Jul 2017 10:01:14 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4449F6FE60; Wed, 26 Jul 2017 10:01:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 40BF4806BF Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:48 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 18/24] tests: qemumonitorjson: Add data and fix 'same-backing' node detection case 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 26 Jul 2017 10:03:19 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" With the new approach we are actually able to correctly detect node names for the two instances of the same backing file. --- ...nitorjson-nodename-same-backing-blockstats.json | 221 +++++++++++++++++= ++++ ...itorjson-nodename-same-backing-named-nodes.json | 16 +- .../qemumonitorjson-nodename-same-backing.result | 28 ++- tests/qemumonitorjsontest.c | 2 +- 4 files changed, 252 insertions(+), 15 deletions(-) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-same= -backing-blockstats.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backin= g-blockstats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same= -backing-blockstats.json new file mode 100644 index 000000000..7fd238301 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-block= stats.json @@ -0,0 +1,221 @@ +[ + { + "device": "drive-sata0-0-0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block020" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 290083, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 512, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 74812730779, + "rd_operations": 1, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block224" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block320" + }, + "node-name": "#block132" + }, + { + "device": "drive-sata0-0-1", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block487" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": true, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block692" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block771" + }, + "node-name": "#block548" + } + ] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backin= g-named-nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-sam= e-backing-named-nodes.json index 78954bb25..3945ff5ed 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-named= -nodes.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-named= -nodes.json @@ -21,7 +21,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block729", + "node-name": "#block771", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, @@ -50,7 +50,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block628", + "node-name": "#block692", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -109,7 +109,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block574", + "node-name": "#block548", "backing_file_depth": 1, "drv": "qcow2", "iops": 0, @@ -139,7 +139,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block405", + "node-name": "#block487", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -178,7 +178,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block399", + "node-name": "#block320", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, @@ -207,7 +207,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block257", + "node-name": "#block224", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -266,7 +266,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block170", + "node-name": "#block132", "backing_file_depth": 1, "drv": "qcow2", "iops": 0, @@ -296,7 +296,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block057", + "node-name": "#block020", "backing_file_depth": 0, "drv": "file", "iops": 0, diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backin= g.result b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.= result index 3ad8423a3..87431f7ca 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.result @@ -1,7 +1,23 @@ -filename : '/var/lib/libvirt/images/a.qcow2' -format node : '#block170' -storage node: '#block057' - +drive-sata0-0-1 filename : '/var/lib/libvirt/images/b.qcow2' -format node : '#block574' -storage node: '#block405' +format node : '#block548' +format drv : 'qcow2' +storage node: '#block487' +storage drv : 'file' + filename : '/var/lib/libvirt/images/base.qcow2' + format node : '#block771' + format drv : 'qcow2' + storage node: '#block692' + storage drv : 'file' + +drive-sata0-0-0 +filename : '/var/lib/libvirt/images/a.qcow2' +format node : '#block132' +format drv : 'qcow2' +storage node: '#block020' +storage drv : 'file' + filename : '/var/lib/libvirt/images/base.qcow2' + format node : '#block320' + format drv : 'qcow2' + storage node: '#block224' + storage drv : 'file' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 346d5c401..e85cf7b24 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2927,7 +2927,7 @@ mymain(void) } while (0) DO_TEST_BLOCK_NODE_DETECT("basic"); -/* DO_TEST_BLOCK_NODE_DETECT("same-backing"); */ + DO_TEST_BLOCK_NODE_DETECT("same-backing"); /* DO_TEST_BLOCK_NODE_DETECT("relative"); */ /* DO_TEST_BLOCK_NODE_DETECT("gluster"); */ --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063408835554.5103661602938; Wed, 26 Jul 2017 03:03:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id F0E3C4A6E4; Wed, 26 Jul 2017 10:03:23 +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 AFC8F6FE6D; Wed, 26 Jul 2017 10:03:23 +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 ECC18180BA90; Wed, 26 Jul 2017 10:03:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1FGH008929 for ; Wed, 26 Jul 2017 06:01:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id E30A86FE6A; Wed, 26 Jul 2017 10:01:15 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 409046FE6E; Wed, 26 Jul 2017 10:01:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F0E3C4A6E4 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:49 +0200 Message-Id: <6115b55ec7123edf545e8f848b274adf5eeb016f.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 19/24] tests: qemumonitorjson: Fix 'relative' node name detection test case 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 26 Jul 2017 10:03:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add the blockstats data and fix the expected output. --- ...mumonitorjson-nodename-relative-blockstats.json | 329 +++++++++++++++++= ++++ ...umonitorjson-nodename-relative-named-nodes.json | 26 +- .../qemumonitorjson-nodename-relative.result | 44 ++- tests/qemumonitorjsontest.c | 2 +- 4 files changed, 372 insertions(+), 29 deletions(-) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-rela= tive-blockstats.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-bl= ockstats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative= -blockstats.json new file mode 100644 index 000000000..9838ad1a7 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-blockstat= s.json @@ -0,0 +1,329 @@ +[ + { + "device": "drive-ide0-0-0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block092" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 61904, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 512, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 309814663943, + "rd_operations": 1, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block232" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block442" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block614" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block797" + }, + "node-name": "#block548" + }, + "node-name": "#block346" + }, + "node-name": "#block118" + }, + { + "device": "drive-ide0-0-1", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block1107" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": true, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block800" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block927" + }, + "node-name": "#block1290" + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-na= med-nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relativ= e-named-nodes.json index 1fee149ac..2fcc3b47e 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-named-nod= es.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-named-nod= es.json @@ -41,7 +41,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block1177", + "node-name": "#block1290", "backing_file_depth": 1, "drv": "qcow2", "iops": 0, @@ -71,7 +71,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block1027", + "node-name": "#block1107", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -110,7 +110,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block957", + "node-name": "#block927", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, @@ -139,7 +139,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block840", + "node-name": "#block800", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -178,7 +178,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block709", + "node-name": "#block797", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, @@ -207,7 +207,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block665", + "node-name": "#block614", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -266,7 +266,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block514", + "node-name": "#block548", "backing_file_depth": 1, "drv": "qcow2", "iops": 0, @@ -296,7 +296,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block481", + "node-name": "#block442", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -375,7 +375,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block357", + "node-name": "#block346", "backing_file_depth": 2, "drv": "qcow2", "iops": 0, @@ -405,7 +405,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block290", + "node-name": "#block232", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -504,7 +504,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block153", + "node-name": "#block118", "backing_file_depth": 3, "drv": "qcow2", "iops": 0, @@ -534,7 +534,7 @@ }, "iops_wr": 0, "ro": false, - "node-name": "#block076", + "node-name": "#block092", "backing_file_depth": 0, "drv": "file", "iops": 0, @@ -551,4 +551,4 @@ "file": "/var/lib/libvirt/images/img3", "encryption_key_missing": false } - ] +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.re= sult b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.result index 27d9652c6..6c0c77618 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.result @@ -1,19 +1,33 @@ +drive-ide0-0-1 +filename : '/var/lib/libvirt/images/relsnap.qcow2' +format node : '#block1290' +format drv : 'qcow2' +storage node: '#block1107' +storage drv : 'file' + filename : '/var/lib/libvirt/images/base.qcow2' + format node : '#block927' + format drv : 'qcow2' + storage node: '#block800' + storage drv : 'file' + +drive-ide0-0-0 filename : '/var/lib/libvirt/images/img3' -format node : '#block153' -storage node: '#block076' +format node : '#block118' +format drv : 'qcow2' +storage node: '#block092' +storage drv : 'file' filename : '/var/lib/libvirt/images/img2' - format node : '#block357' - storage node: '#block290' + format node : '#block346' + format drv : 'qcow2' + storage node: '#block232' + storage drv : 'file' filename : '/var/lib/libvirt/images/img1' - format node : '#block514' - storage node: '#block481' + format node : '#block548' + format drv : 'qcow2' + storage node: '#block442' + storage drv : 'file' filename : '/var/lib/libvirt/images/img0' - format node : '#block709' - storage node: '#block665' - -filename : '/var/lib/libvirt/images/relsnap.qcow2' -format node : '#block1177' -storage node: '#block1027' - filename : '/var/lib/libvirt/images/base.qcow2' - format node : '#block957' - storage node: '#block840' + format node : '#block797' + format drv : 'qcow2' + storage node: '#block614' + storage drv : 'file' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index e85cf7b24..2b10a75cd 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2928,7 +2928,7 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("basic"); DO_TEST_BLOCK_NODE_DETECT("same-backing"); -/* DO_TEST_BLOCK_NODE_DETECT("relative"); */ + DO_TEST_BLOCK_NODE_DETECT("relative"); /* DO_TEST_BLOCK_NODE_DETECT("gluster"); */ #undef DO_TEST_BLOCK_NODE_DETECT --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063383508653.770962314821; Wed, 26 Jul 2017 03:03:03 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id ADD25A9644; Wed, 26 Jul 2017 10:02:59 +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 7BEA86FE6D; Wed, 26 Jul 2017 10:02:59 +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 D775014B2D; Wed, 26 Jul 2017 10:02:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1GYP008937 for ; Wed, 26 Jul 2017 06:01:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id E23C16FE76; Wed, 26 Jul 2017 10:01:16 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BD156FE60; Wed, 26 Jul 2017 10:01:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ADD25A9644 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:50 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 20/24] tests: qemumonitorjson: Fix 'gluster' node name detection test case 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 26 Jul 2017 10:03:00 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add the blockstats data and fix the expected output. --- ...emumonitorjson-nodename-gluster-blockstats.json | 111 +++++++++++++++++= ++++ ...mumonitorjson-nodename-gluster-named-nodes.json | 90 ++++++++--------- .../qemumonitorjson-nodename-gluster.result | 15 ++- tests/qemumonitorjsontest.c | 2 +- 4 files changed, 167 insertions(+), 51 deletions(-) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-glus= ter-blockstats.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blo= ckstats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-b= lockstats.json new file mode 100644 index 000000000..665a6b05b --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blockstats= .json @@ -0,0 +1,111 @@ +[ + { + "device": "drive-virtio-disk0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block282" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": true, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block477" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block596" + }, + "node-name": "#block338" + } + ] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-nam= ed-nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-= named-nodes.json index 7ea5c5d54..e6bd2cfa7 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-node= s.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-node= s.json @@ -3,40 +3,19 @@ "iops_rd": 0, "detect_zeroes": "off", "image": { - "backing-image": { - "virtual-size": 197120, - "filename": "gluster://gluster-host/vol0/img0", - "format": "raw", - "actual-size": 197120 - }, - "backing-filename-format": "raw", "virtual-size": 197120, - "filename": "gluster://gluster-host/vol0/img1", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 197120, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "gluster://gluster-host/vol0/img0", - "backing-filename": "gluster://gluster-host/vol0/img0", - "dirty-flag": false + "filename": "gluster://gluster-host/vol0/img0", + "format": "raw", + "actual-size": 197120 }, "iops_wr": 0, - "ro": false, - "node-name": "#block1008", - "backing_file_depth": 1, - "drv": "qcow2", + "ro": true, + "node-name": "#block596", + "backing_file_depth": 0, + "drv": "raw", "iops": 0, "bps_wr": 0, "write_threshold": 0, - "backing_file": "gluster://gluster-host/vol0/img0", "encrypted": false, "bps": 0, "bps_rd": 0, @@ -45,7 +24,7 @@ "direct": true, "writeback": true }, - "file": "gluster://gluster-host/vol0/img1", + "file": "gluster://gluster-host/vol0/img0", "encryption_key_missing": false }, { @@ -53,13 +32,13 @@ "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "gluster://gluster-host/vol0/img1", + "filename": "gluster://gluster-host/vol0/img0", "format": "gluster", "actual-size": 197120 }, "iops_wr": 0, - "ro": false, - "node-name": "#block981", + "ro": true, + "node-name": "#block477", "backing_file_depth": 0, "drv": "gluster", "iops": 0, @@ -73,26 +52,47 @@ "direct": true, "writeback": true }, - "file": "gluster://gluster-host/vol0/img1", + "file": "gluster://gluster-host/vol0/img0", "encryption_key_missing": false }, { "iops_rd": 0, "detect_zeroes": "off", "image": { + "backing-image": { + "virtual-size": 197120, + "filename": "gluster://gluster-host/vol0/img0", + "format": "raw", + "actual-size": 197120 + }, + "backing-filename-format": "raw", "virtual-size": 197120, - "filename": "gluster://gluster-host/vol0/img0", - "format": "raw", - "actual-size": 197120 + "filename": "gluster://gluster-host:24007/vol0/img1", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 197120, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "gluster://gluster-host/vol0/img0", + "backing-filename": "gluster://gluster-host/vol0/img0", + "dirty-flag": false }, "iops_wr": 0, - "ro": true, - "node-name": "#block349", - "backing_file_depth": 0, - "drv": "raw", + "ro": false, + "node-name": "#block338", + "backing_file_depth": 1, + "drv": "qcow2", "iops": 0, "bps_wr": 0, "write_threshold": 0, + "backing_file": "gluster://gluster-host/vol0/img0", "encrypted": false, "bps": 0, "bps_rd": 0, @@ -101,7 +101,7 @@ "direct": true, "writeback": true }, - "file": "gluster://gluster-host/vol0/img0", + "file": "gluster://gluster-host:24007/vol0/img1", "encryption_key_missing": false }, { @@ -109,13 +109,13 @@ "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "gluster://gluster-host/vol0/img0", + "filename": "gluster://gluster-host:24007/vol0/img1", "format": "gluster", "actual-size": 197120 }, "iops_wr": 0, - "ro": true, - "node-name": "#block269", + "ro": false, + "node-name": "#block282", "backing_file_depth": 0, "drv": "gluster", "iops": 0, @@ -129,7 +129,7 @@ "direct": true, "writeback": true }, - "file": "gluster://gluster-host/vol0/img0", + "file": "gluster://gluster-host:24007/vol0/img1", "encryption_key_missing": false } ] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.res= ult b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result index d99576202..6289fdd1a 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result @@ -1,6 +1,11 @@ -filename : 'gluster://gluster-host/vol0/img1' -format node : '#block1008' -storage node: '#block981' +drive-virtio-disk0 +filename : 'gluster://gluster-host:24007/vol0/img1' +format node : '#block338' +format drv : 'qcow2' +storage node: '#block282' +storage drv : 'gluster' filename : 'gluster://gluster-host/vol0/img0' - format node : '#block349' - storage node: '#block269' + format node : '#block596' + format drv : 'raw' + storage node: '#block477' + storage drv : 'gluster' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 2b10a75cd..8edb3f121 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2929,7 +2929,7 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("basic"); DO_TEST_BLOCK_NODE_DETECT("same-backing"); DO_TEST_BLOCK_NODE_DETECT("relative"); -/* DO_TEST_BLOCK_NODE_DETECT("gluster"); */ + DO_TEST_BLOCK_NODE_DETECT("gluster"); #undef DO_TEST_BLOCK_NODE_DETECT --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063451225871.2103369494112; Wed, 26 Jul 2017 03:04:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 571A2A8A6; Wed, 26 Jul 2017 10:04:08 +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 040D66FDB8; Wed, 26 Jul 2017 10:04:07 +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 9F2A8388F; Wed, 26 Jul 2017 10:03:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1Iex008952 for ; Wed, 26 Jul 2017 06:01:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1D0C451C89; Wed, 26 Jul 2017 10:01:18 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3961F6FE60; Wed, 26 Jul 2017 10:01:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 571A2A8A6 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:51 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 21/24] tests: qemumonitorjson: Add test case for node name detection with blockjob 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 26 Jul 2017 10:04:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" qemu 2.9 returns an extra layer in the backing data if a block job is active. Add a test case to see whether our code properly detects and ignores such layer. --- ...mumonitorjson-nodename-blockjob-blockstats.json | 301 +++++++++ ...umonitorjson-nodename-blockjob-named-nodes.json | 682 +++++++++++++++++= ++++ .../qemumonitorjson-nodename-blockjob.result | 26 + tests/qemumonitorjsontest.c | 1 + 4 files changed, 1010 insertions(+) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-bloc= kjob-blockstats.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-bloc= kjob-named-nodes.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-bloc= kjob.result diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-bl= ockstats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob= -blockstats.json new file mode 100644 index 000000000..51cd664c2 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-blockstat= s.json @@ -0,0 +1,301 @@ +[ + { + "device": "drive-ide0-0-0", + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 99763, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 512, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 1142142388760097, + "rd_operations": 1, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block042" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block259" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block449" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block618" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block846" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block901" + }, + "node-name": "#block717" + }, + "node-name": "#block551" + }, + "node-name": "#block312" + }, + "node-name": "#block179" + }, + "node-name": "#block3343" + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-na= med-nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjo= b-named-nodes.json new file mode 100644 index 000000000..3cebb23a9 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-named-nod= es.json @@ -0,0 +1,682 @@ +[ + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-image": { + "backing-image": { + "backing-image": { + "backing-image": { + "backing-image": { + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/a", + "format": "raw", + "actual-size": 0, + "dirty-flag": false + }, + "backing-filename-format": "raw", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/c", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/a", + "backing-filename": "/var/lib/libvirt/images/a", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/c", + "backing-filename": "/var/lib/libvirt/images/c", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d.1499152668", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/d", + "backing-filename": "/var/lib/libvirt/images/d", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d.1499152698", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/d.1499152668", + "backing-filename": "/var/lib/libvirt/images/d.1499152668", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d.1499152698", + "format": "mirror_top", + "full-backing-filename": "/var/lib/libvirt/images/d.1499152698", + "backing-filename": "/var/lib/libvirt/images/d.1499152698" + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block3343", + "backing_file_depth": 5, + "drv": "mirror_top", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/var/lib/libvirt/images/d.1499152698", + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/d.1499152698", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 10485760, + "filename": "/tmp/kkt", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 266240, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block3243", + "backing_file_depth": 0, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/kkt", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 327680, + "filename": "/tmp/kkt", + "format": "file", + "actual-size": 266240, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block3144", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/tmp/kkt", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/a", + "format": "raw", + "actual-size": 0, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "#block901", + "backing_file_depth": 0, + "drv": "raw", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/a", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/a", + "format": "file", + "actual-size": 0, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "#block846", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/a", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-image": { + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/a", + "format": "raw", + "actual-size": 0, + "dirty-flag": false + }, + "backing-filename-format": "raw", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/c", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/a", + "backing-filename": "/var/lib/libvirt/images/a", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "#block717", + "backing_file_depth": 1, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/var/lib/libvirt/images/a", + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/c", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 197120, + "filename": "/var/lib/libvirt/images/c", + "format": "file", + "actual-size": 200704, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "#block618", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/c", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-image": { + "backing-image": { + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/a", + "format": "raw", + "actual-size": 0, + "dirty-flag": false + }, + "backing-filename-format": "raw", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/c", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/a", + "backing-filename": "/var/lib/libvirt/images/a", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/c", + "backing-filename": "/var/lib/libvirt/images/c", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "#block551", + "backing_file_depth": 2, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/var/lib/libvirt/images/c", + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/d", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 197120, + "filename": "/var/lib/libvirt/images/d", + "format": "file", + "actual-size": 200704, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "#block449", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/d", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-image": { + "backing-image": { + "backing-image": { + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/a", + "format": "raw", + "actual-size": 0, + "dirty-flag": false + }, + "backing-filename-format": "raw", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/c", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/a", + "backing-filename": "/var/lib/libvirt/images/a", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/c", + "backing-filename": "/var/lib/libvirt/images/c", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d.1499152668", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/d", + "backing-filename": "/var/lib/libvirt/images/d", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "#block312", + "backing_file_depth": 3, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/var/lib/libvirt/images/d", + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/d.1499152668", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 197120, + "filename": "/var/lib/libvirt/images/d.1499152668", + "format": "file", + "actual-size": 200704, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": true, + "node-name": "#block259", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/d.1499152668", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-image": { + "backing-image": { + "backing-image": { + "backing-image": { + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/a", + "format": "raw", + "actual-size": 0, + "dirty-flag": false + }, + "backing-filename-format": "raw", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/c", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/a", + "backing-filename": "/var/lib/libvirt/images/a", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/c", + "backing-filename": "/var/lib/libvirt/images/c", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d.1499152668", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/d", + "backing-filename": "/var/lib/libvirt/images/d", + "dirty-flag": false + }, + "backing-filename-format": "qcow2", + "virtual-size": 10485760, + "filename": "/var/lib/libvirt/images/d.1499152698", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 200704, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "/var/lib/libvirt/images/d.1499152668", + "backing-filename": "/var/lib/libvirt/images/d.1499152668", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block179", + "backing_file_depth": 4, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "/var/lib/libvirt/images/d.1499152668", + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/d.1499152698", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 197120, + "filename": "/var/lib/libvirt/images/d.1499152698", + "format": "file", + "actual-size": 200704, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block042", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/d.1499152698", + "encryption_key_missing": false + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.re= sult b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result new file mode 100644 index 000000000..4abe6f934 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result @@ -0,0 +1,26 @@ +drive-ide0-0-0 +filename : '/var/lib/libvirt/images/d.1499152698' +format node : '#block179' +format drv : 'qcow2' +storage node: '#block042' +storage drv : 'file' + filename : '/var/lib/libvirt/images/d.1499152668' + format node : '#block312' + format drv : 'qcow2' + storage node: '#block259' + storage drv : 'file' + filename : '/var/lib/libvirt/images/d' + format node : '#block551' + format drv : 'qcow2' + storage node: '#block449' + storage drv : 'file' + filename : '/var/lib/libvirt/images/c' + format node : '#block717' + format drv : 'qcow2' + storage node: '#block618' + storage drv : 'file' + filename : '/var/lib/libvirt/images/a' + format node : '#block901' + format drv : 'raw' + storage node: '#block846' + storage drv : 'file' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 8edb3f121..0601c1188 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2930,6 +2930,7 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("same-backing"); DO_TEST_BLOCK_NODE_DETECT("relative"); DO_TEST_BLOCK_NODE_DETECT("gluster"); + DO_TEST_BLOCK_NODE_DETECT("blockjob"); #undef DO_TEST_BLOCK_NODE_DETECT --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063421891777.5031145875255; Wed, 26 Jul 2017 03:03:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2240EFBB5; Wed, 26 Jul 2017 10:03:39 +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 E9FE568D92; Wed, 26 Jul 2017 10:03:38 +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 37998180BA9B; Wed, 26 Jul 2017 10:03:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1JYu008960 for ; Wed, 26 Jul 2017 06:01:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 19E5B6FB61; Wed, 26 Jul 2017 10:01:19 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A9916FE60; Wed, 26 Jul 2017 10:01:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2240EFBB5 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:52 +0200 Message-Id: <27b36678ace48789c4818f58b64666096e928e8a.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 22/24] tests: qemumonitorjson: Old and empty test case for node name detection 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 26 Jul 2017 10:03:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Prior to qemu 2.5 the node names would not be generated, thus would be missing from 'query-blockstats' and 'query-named-block-nodes'. Test that the code correctly detects nothing. Additionally make sure that a VM without disks does not cause problems. The test case change is necessary as our test file checker does not play well with empty files. --- .../qemumonitorjson-nodename-empty-blockstats.json | 2 + ...qemumonitorjson-nodename-empty-named-nodes.json | 2 + .../qemumonitorjson-nodename-empty.result | 1 + .../qemumonitorjson-nodename-old-blockstats.json | 160 +++++++++++++++++= ++++ .../qemumonitorjson-nodename-old-named-nodes.json | 2 + .../qemumonitorjson-nodename-old.result | 1 + tests/qemumonitorjsontest.c | 5 + 7 files changed, 173 insertions(+) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empt= y-blockstats.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empt= y-named-nodes.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empt= y.result create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old-= blockstats.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old-= named-nodes.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old.= result diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-block= stats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-block= stats.json new file mode 100644 index 000000000..0d4f101c7 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-blockstats.j= son @@ -0,0 +1,2 @@ +[ +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-named= -nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-name= d-nodes.json new file mode 100644 index 000000000..0d4f101c7 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-named-nodes.= json @@ -0,0 +1,2 @@ +[ +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.resul= t b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.result new file mode 100644 index 000000000..9dafe9be2 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.result @@ -0,0 +1 @@ +nothing diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockst= ats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockstat= s.json new file mode 100644 index 000000000..26c14f9f2 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockstats.json @@ -0,0 +1,160 @@ +[ + { + "device": "drive-virtio-disk0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 32899072, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + } + }, + "stats": { + "flush_total_time_ns": 452246313, + "wr_highest_offset": 8072282112, + "wr_total_time_ns": 4803102521, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 8, + "wr_bytes": 6517248, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 11065169148, + "flush_operations": 10, + "wr_operations": 129, + "rd_merged": 77, + "rd_bytes": 76399104, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 22663656304, + "rd_operations": 4038, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + } + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + } + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + } + } + } + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-n= odes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-no= des.json new file mode 100644 index 000000000..0d4f101c7 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-nodes.js= on @@ -0,0 +1,2 @@ +[ +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result = b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result new file mode 100644 index 000000000..9dafe9be2 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result @@ -0,0 +1 @@ +nothing diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 0601c1188..06d97989e 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2763,6 +2763,9 @@ testBlockNodeNameDetect(const void *opaque) virBufferTrim(&buf, "\n", -1); + if (virBufferUse(&buf) =3D=3D 0) + virBufferAddLit(&buf, "nothing\n"); + if (virBufferCheckError(&buf) < 0) goto cleanup; @@ -2931,6 +2934,8 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("relative"); DO_TEST_BLOCK_NODE_DETECT("gluster"); DO_TEST_BLOCK_NODE_DETECT("blockjob"); + DO_TEST_BLOCK_NODE_DETECT("old"); + DO_TEST_BLOCK_NODE_DETECT("empty"); #undef DO_TEST_BLOCK_NODE_DETECT --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063414526579.413137982056; Wed, 26 Jul 2017 03:03:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3938655B; Wed, 26 Jul 2017 10:03:28 +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 5B24268893; Wed, 26 Jul 2017 10:03:28 +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 44AA414B33; Wed, 26 Jul 2017 10:03:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1Kw9008969 for ; Wed, 26 Jul 2017 06:01:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 165136FB61; Wed, 26 Jul 2017 10:01:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6738351C89; Wed, 26 Jul 2017 10:01:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B3938655B Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:53 +0200 Message-Id: <7dfc7af984da99eb7e1ff577570f720fa74e35c6.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 23/24] tests: qemumonitorjson: Test extraction of LUKS node names 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 26 Jul 2017 10:03:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- .../qemumonitorjson-nodename-luks-blockstats.json | 58 +++++++++++ .../qemumonitorjson-nodename-luks-named-nodes.json | 109 +++++++++++++++++= ++++ .../qemumonitorjson-nodename-luks.result | 6 ++ tests/qemumonitorjsontest.c | 1 + 4 files changed, 174 insertions(+) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks= -blockstats.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks= -named-nodes.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-luks= .result diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-blocks= tats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-blockst= ats.json new file mode 100644 index 000000000..6f971b2af --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-blockstats.js= on @@ -0,0 +1,58 @@ +[ + { + "device": "drive-virtio-disk0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block033" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 89560, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 512, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 323120536984, + "rd_operations": 1, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block136" + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-named-= nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-named-= nodes.json new file mode 100644 index 000000000..8de6d6c6a --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks-named-nodes.j= son @@ -0,0 +1,109 @@ +[ + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 10485760, + "filename": "json:{\"driver\": \"luks\", \"file\": {\"driver\": \"= file\", \"filename\": \"/var/lib/libvirt/images/luks\"}, \"key-secret\": \"= virtio-disk0-luks-secret0\"}", + "format": "luks", + "actual-size": 262144, + "format-specific": { + "type": "luks", + "data": { + "ivgen-alg": "plain64", + "hash-alg": "sha256", + "cipher-alg": "aes-256", + "uuid": "687ef639-c687-40d3-a103-7b4bdaa6e74a", + "cipher-mode": "xts", + "slots": [ + { + "active": true, + "iters": 1886334, + "key-offset": 4096, + "stripes": 4000 + }, + { + "active": false, + "key-offset": 262144 + }, + { + "active": false, + "key-offset": 520192 + }, + { + "active": false, + "key-offset": 778240 + }, + { + "active": false, + "key-offset": 1036288 + }, + { + "active": false, + "key-offset": 1294336 + }, + { + "active": false, + "key-offset": 1552384 + }, + { + "active": false, + "key-offset": 1810432 + } + ], + "payload-offset": 2068480, + "master-key-iters": 484865 + } + }, + "encrypted": true, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block136", + "backing_file_depth": 0, + "drv": "luks", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": true, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"driver\": \"luks\", \"file\": {\"driver\": \"file\"= , \"filename\": \"/var/lib/libvirt/images/luks\"}, \"key-secret\": \"virtio= -disk0-luks-secret0\"}", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 12554240, + "filename": "/var/lib/libvirt/images/luks", + "format": "file", + "actual-size": 262144, + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block033", + "backing_file_depth": 0, + "drv": "file", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "/var/lib/libvirt/images/luks", + "encryption_key_missing": false + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks.result= b/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks.result new file mode 100644 index 000000000..6a6b37519 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-luks.result @@ -0,0 +1,6 @@ +drive-virtio-disk0 +filename : '/var/lib/libvirt/images/luks' +format node : '#block136' +format drv : 'luks' +storage node: '#block033' +storage drv : 'file' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 06d97989e..f4169e550 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2936,6 +2936,7 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("blockjob"); DO_TEST_BLOCK_NODE_DETECT("old"); DO_TEST_BLOCK_NODE_DETECT("empty"); + DO_TEST_BLOCK_NODE_DETECT("luks"); #undef DO_TEST_BLOCK_NODE_DETECT --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:58:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063427079401.0863099163621; Wed, 26 Jul 2017 03:03:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2516B883CD; Wed, 26 Jul 2017 10:03:45 +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 EEE8C6A745; Wed, 26 Jul 2017 10:03:44 +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 9390C26B; Wed, 26 Jul 2017 10:03:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1MMk008977 for ; Wed, 26 Jul 2017 06:01:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC2F851C89; Wed, 26 Jul 2017 10:01:22 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AF166FB61; Wed, 26 Jul 2017 10:01:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2516B883CD Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:54 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 26 Jul 2017 10:03:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- .../qemumonitorjson-nodename-iscsi-blockstats.json | 113 +++++++++++++++++= +++ ...qemumonitorjson-nodename-iscsi-named-nodes.json | 114 +++++++++++++++++= ++++ .../qemumonitorjson-nodename-iscsi.result | 13 +++ tests/qemumonitorjsontest.c | 1 + 4 files changed, 241 insertions(+) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscs= i-blockstats.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscs= i-named-nodes.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscs= i.result diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-block= stats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-block= stats.json new file mode 100644 index 000000000..b13386ecb --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.j= son @@ -0,0 +1,113 @@ +[ + { + "device": "drive-virtio-disk0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block038" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 995504, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 512, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 117550038551, + "rd_operations": 1, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block169" + }, + { + "device": "drive-scsi0-0-1", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block250" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": true, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block301" + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named= -nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-name= d-nodes.json new file mode 100644 index 000000000..6a04e62c0 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.= json @@ -0,0 +1,114 @@ +[ + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 1073741824, + "filename": "json:{\"driver\": \"raw\", \"file\": {\"lun\": \"0\",= \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"= tcp\", \"target\": \"iqn.2016-09.com.example:server\"}}", + "format": "raw", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block301", + "backing_file_depth": 0, + "drv": "raw", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"driver\": \"raw\", \"file\": {\"lun\": \"0\", \"por= tal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\",= \"target\": \"iqn.2016-09.com.example:server\"}}", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 1073741824, + "filename": "json:{\"lun\": \"0\", \"portal\": \"example.com:3260\= ", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09= .com.example:server\"}", + "format": "iscsi", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block250", + "backing_file_depth": 0, + "drv": "iscsi", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"lun\": \"0\", \"portal\": \"example.com:3260\", \"d= river\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.e= xample:server\"}", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 1073741824, + "filename": "json:{\"driver\": \"raw\", \"file\": {\"lun\": \"0\",= \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"= tcp\", \"target\": \"iqn.2016-09.com.example:server\"}}", + "format": "raw", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block169", + "backing_file_depth": 0, + "drv": "raw", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"driver\": \"raw\", \"file\": {\"lun\": \"0\", \"por= tal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\",= \"target\": \"iqn.2016-09.com.example:server\"}}", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 1073741824, + "filename": "json:{\"lun\": \"0\", \"portal\": \"example.com:3260\= ", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09= .com.example:server\"}", + "format": "iscsi", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block038", + "backing_file_depth": 0, + "drv": "iscsi", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"lun\": \"0\", \"portal\": \"example.com:3260\", \"d= river\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.e= xample:server\"}", + "encryption_key_missing": false + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.resul= t b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result new file mode 100644 index 000000000..3ffe55340 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result @@ -0,0 +1,13 @@ +drive-scsi0-0-1 +filename : 'json:{"lun": "0", "portal": "example.com:3260", "driver": "= iscsi", "transport": "tcp", "target": "iqn.2016-09.com.example:server"}' +format node : '#block301' +format drv : 'raw' +storage node: '#block250' +storage drv : 'iscsi' + +drive-virtio-disk0 +filename : 'json:{"lun": "0", "portal": "example.com:3260", "driver": "= iscsi", "transport": "tcp", "target": "iqn.2016-09.com.example:server"}' +format node : '#block169' +format drv : 'raw' +storage node: '#block038' +storage drv : 'iscsi' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index f4169e550..150a1d879 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2937,6 +2937,7 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("old"); DO_TEST_BLOCK_NODE_DETECT("empty"); DO_TEST_BLOCK_NODE_DETECT("luks"); + DO_TEST_BLOCK_NODE_DETECT("iscsi"); #undef DO_TEST_BLOCK_NODE_DETECT --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list