From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716884473920.0994570509896; Tue, 23 Jan 2018 06:14:44 -0800 (PST) Received: from localhost ([::1]:59792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzLX-00051N-Mp for importer@patchew.org; Tue, 23 Jan 2018 09:14:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9k-0003Qq-BI for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9a-0005lq-Ra for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63300) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9N-0005bX-EH; Tue, 23 Jan 2018 09:02:09 -0500 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 7AE7B5F739; Tue, 23 Jan 2018 14:02:08 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F8978517; Tue, 23 Jan 2018 14:02:07 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:33 +0100 Message-Id: <20180123140201.31163-2-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.39]); Tue, 23 Jan 2018 14:02:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/29] osdep: Retry SETLK upon EINTR X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Fam Zheng We could hit lock failure if there is a signal that makes fcntl return -1 and errno set to EINTR. In this case we should retry. Cc: qemu-stable@nongnu.org Signed-off-by: Fam Zheng Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- util/osdep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/osdep.c b/util/osdep.c index 1231f9f876..a73de0e1ba 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -244,7 +244,9 @@ static int qemu_lock_fcntl(int fd, int64_t start, int64= _t len, int fl_type) .l_type =3D fl_type, }; qemu_probe_lock_ops(); - ret =3D fcntl(fd, fcntl_op_setlk, &fl); + do { + ret =3D fcntl(fd, fcntl_op_setlk, &fl); + } while (ret =3D=3D -1 && errno =3D=3D EINTR); return ret =3D=3D -1 ? -errno : 0; } =20 --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716466219204.02141688871598; Tue, 23 Jan 2018 06:07:46 -0800 (PST) Received: from localhost ([::1]:59739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzEn-0007Id-Cr for importer@patchew.org; Tue, 23 Jan 2018 09:07:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9e-0003NQ-MF for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9Y-0005k6-Jb for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41232) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9O-0005cC-T6; Tue, 23 Jan 2018 09:02:11 -0500 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 EF82C99DA1; Tue, 23 Jan 2018 14:02:09 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id C44768517; Tue, 23 Jan 2018 14:02:08 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:34 +0100 Message-Id: <20180123140201.31163-3-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.38]); Tue, 23 Jan 2018 14:02:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/29] hw/block: Fix pin-based interrupt behaviour of NVMe X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Hikaru Nishida Pin-based interrupt of NVMe controller did not work properly because using an obsolated function pci_irq_pulse(). To fix this, change to use pci_irq_assert() / pci_irq_deassert() instead of pci_irq_pulse(). Signed-off-by: Hikaru Nishida Reviewed-by: Keith Busch Signed-off-by: Kevin Wolf --- hw/block/nvme.h | 1 + hw/block/nvme.c | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/hw/block/nvme.h b/hw/block/nvme.h index 6aab338ff5..7b62dad072 100644 --- a/hw/block/nvme.h +++ b/hw/block/nvme.h @@ -775,6 +775,7 @@ typedef struct NvmeCtrl { uint32_t cmbsz; uint32_t cmbloc; uint8_t *cmbuf; + uint64_t irq_status; =20 char *serial; NvmeNamespace *namespaces; diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 1ac356d3a5..51a58fefba 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -91,7 +91,19 @@ static uint8_t nvme_sq_empty(NvmeSQueue *sq) return sq->head =3D=3D sq->tail; } =20 -static void nvme_isr_notify(NvmeCtrl *n, NvmeCQueue *cq) +static void nvme_irq_check(NvmeCtrl *n) +{ + if (msix_enabled(&(n->parent_obj))) { + return; + } + if (~n->bar.intms & n->irq_status) { + pci_irq_assert(&n->parent_obj); + } else { + pci_irq_deassert(&n->parent_obj); + } +} + +static void nvme_irq_assert(NvmeCtrl *n, NvmeCQueue *cq) { if (cq->irq_enabled) { if (msix_enabled(&(n->parent_obj))) { @@ -99,13 +111,28 @@ static void nvme_isr_notify(NvmeCtrl *n, NvmeCQueue *c= q) msix_notify(&(n->parent_obj), cq->vector); } else { trace_nvme_irq_pin(); - pci_irq_pulse(&n->parent_obj); + assert(cq->cqid < 64); + n->irq_status |=3D 1 << cq->cqid; + nvme_irq_check(n); } } else { trace_nvme_irq_masked(); } } =20 +static void nvme_irq_deassert(NvmeCtrl *n, NvmeCQueue *cq) +{ + if (cq->irq_enabled) { + if (msix_enabled(&(n->parent_obj))) { + return; + } else { + assert(cq->cqid < 64); + n->irq_status &=3D ~(1 << cq->cqid); + nvme_irq_check(n); + } + } +} + static uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector *iov, uint64_t = prp1, uint64_t prp2, uint32_t len, NvmeCtrl *n) { @@ -242,7 +269,7 @@ static void nvme_post_cqes(void *opaque) sizeof(req->cqe)); QTAILQ_INSERT_TAIL(&sq->req_list, req, entry); } - nvme_isr_notify(n, cq); + nvme_irq_assert(n, cq); } =20 static void nvme_enqueue_req_completion(NvmeCQueue *cq, NvmeRequest *req) @@ -905,6 +932,7 @@ static void nvme_write_bar(NvmeCtrl *n, hwaddr offset, = uint64_t data, n->bar.intmc =3D n->bar.intms; trace_nvme_mmio_intm_set(data & 0xffffffff, n->bar.intmc); + nvme_irq_check(n); break; case 0x10: /* INTMC */ if (unlikely(msix_enabled(&(n->parent_obj)))) { @@ -917,6 +945,7 @@ static void nvme_write_bar(NvmeCtrl *n, hwaddr offset, = uint64_t data, n->bar.intmc =3D n->bar.intms; trace_nvme_mmio_intm_clr(data & 0xffffffff, n->bar.intmc); + nvme_irq_check(n); break; case 0x14: /* CC */ trace_nvme_mmio_cfg(data & 0xffffffff); @@ -1085,8 +1114,8 @@ static void nvme_process_db(NvmeCtrl *n, hwaddr addr,= int val) timer_mod(cq->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 5= 00); } =20 - if (cq->tail !=3D cq->head) { - nvme_isr_notify(n, cq); + if (cq->tail =3D=3D cq->head) { + nvme_irq_deassert(n, cq); } } else { /* Submission queue doorbell write */ --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716293663813.0338922485603; Tue, 23 Jan 2018 06:04:53 -0800 (PST) Received: from localhost ([::1]:59710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzBz-0004vX-3I for importer@patchew.org; Tue, 23 Jan 2018 09:04:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9i-0003Qn-IQ for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9e-0005oI-Pw for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39088) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9Q-0005d0-7l; Tue, 23 Jan 2018 09:02:12 -0500 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 47CC12CE95B; Tue, 23 Jan 2018 14:02:11 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DB24BAAF; Tue, 23 Jan 2018 14:02:10 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:35 +0100 Message-Id: <20180123140201.31163-4-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.29]); Tue, 23 Jan 2018 14:02:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/29] tests/.gitignore: Add test-bdrv-drain X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 881cfd17 added a new test binary, include it in .gitignore. Reported-by: Eric Blake Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/.gitignore b/tests/.gitignore index 74e55d7264..e5c744b7ed 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -18,6 +18,7 @@ test-aio test-aio-multithread test-arm-mptimer test-base64 +test-bdrv-drain test-bitops test-bitcnt test-blockjob --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716660106738.5314092311623; Tue, 23 Jan 2018 06:11:00 -0800 (PST) Received: from localhost ([::1]:59769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzHl-0001Un-Va for importer@patchew.org; Tue, 23 Jan 2018 09:10:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9h-0003Qj-O5 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9g-0005po-Hu for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40064) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9R-0005eB-RD; Tue, 23 Jan 2018 09:02:14 -0500 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 EBAC28B114; Tue, 23 Jan 2018 14:02:12 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 930168517; Tue, 23 Jan 2018 14:02:11 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:36 +0100 Message-Id: <20180123140201.31163-5-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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]); Tue, 23 Jan 2018 14:02:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/29] tests/qemu-iotests: adding savevm/loadvm with postcopy flag test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Daniel Henrique Barboza This patch implements a test case for the scenario that was failing prior to the patch "migration/ram.c: do not set 'postcopy_running' in POSTCOPY_INCOMING_END", commit acab30b85d. This new test file 201 was derived from the test file 181 authored by Kevin Wolf. CC: Kevin Wolf CC: Max Reitz CC: Cleber Rosa Signed-off-by: Daniel Henrique Barboza Signed-off-by: Kevin Wolf --- tests/qemu-iotests/201 | 120 +++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/201.out | 23 +++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 144 insertions(+) create mode 100755 tests/qemu-iotests/201 create mode 100644 tests/qemu-iotests/201.out diff --git a/tests/qemu-iotests/201 b/tests/qemu-iotests/201 new file mode 100755 index 0000000000..11f640f5df --- /dev/null +++ b/tests/qemu-iotests/201 @@ -0,0 +1,120 @@ +#!/bin/bash +# +# Test savevm and loadvm after live migration with postcopy flag +# +# Copyright (C) 2017, IBM Corporation. +# +# This file is derived from tests/qemu-iotests/181 by Kevin Wolf +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +seq=3D`basename $0` +echo "QA output created by $seq" + +status=3D1 # failure is the default! + +MIG_SOCKET=3D"${TEST_DIR}/migrate" + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.qemu + +_cleanup() +{ + rm -f "${MIG_SOCKET}" + _cleanup_test_img + _cleanup_qemu +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_supported_fmt qcow2 +_supported_proto generic +_supported_os Linux + +# Internal snapshots are (currently) impossible with refcount_bits=3D1 +# This was taken from test 080 +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' + +size=3D64M +_make_test_img $size + +echo +echo =3D=3D=3D Starting VMs =3D=3D=3D +echo + +qemu_comm_method=3D"monitor" + +if [ "$IMGOPTSSYNTAX" =3D "true" ]; then + _launch_qemu \ + -drive "${TEST_IMG}",cache=3D${CACHEMODE},id=3Ddisk +else + _launch_qemu \ + -drive file=3D"${TEST_IMG}",cache=3D${CACHEMODE},driver=3D$IMGFMT,= id=3Ddisk +fi +src=3D$QEMU_HANDLE + +if [ "$IMGOPTSSYNTAX" =3D "true" ]; then + _launch_qemu \ + -drive "${TEST_IMG}",cache=3D${CACHEMODE},id=3Ddisk \ + -incoming "unix:${MIG_SOCKET}" +else + _launch_qemu \ + -drive file=3D"${TEST_IMG}",cache=3D${CACHEMODE},driver=3D$IMGFMT,= id=3Ddisk \ + -incoming "unix:${MIG_SOCKET}" +fi +dest=3D$QEMU_HANDLE + +echo +echo =3D=3D=3D Set \'migrate_set_capability postcopy-ram on\' and migrate = =3D=3D=3D +echo + +silent=3Dyes +_send_qemu_cmd $dest 'migrate_set_capability postcopy-ram on' "(qemu)" +_send_qemu_cmd $src 'migrate_set_capability postcopy-ram on' "(qemu)" +_send_qemu_cmd $src "migrate -d unix:${MIG_SOCKET}" "(qemu)" + +QEMU_COMM_TIMEOUT=3D1 qemu_cmd_repeat=3D10 silent=3Dyes \ + _send_qemu_cmd $src "info migrate" "completed\|failed" +silent=3Dyes _send_qemu_cmd $src "" "(qemu)" + +echo +echo =3D=3D=3D Check if migration was successful =3D=3D=3D +echo + +QEMU_COMM_TIMEOUT=3D1 silent=3Dyes \ + _send_qemu_cmd $src "info migrate" "completed" +silent=3Dyes _send_qemu_cmd $src "" "(qemu)" + +echo +echo =3D=3D=3D On destination, execute savevm and loadvm =3D=3D=3D +echo + +silent=3D +_send_qemu_cmd $dest 'savevm state1' "(qemu)" +_send_qemu_cmd $dest 'loadvm state1' "(qemu)" + +echo +echo =3D=3D=3D Shut down and check image =3D=3D=3D +echo + +_send_qemu_cmd $src 'quit' "" +_send_qemu_cmd $dest 'quit' "" +wait=3D1 _cleanup_qemu + +_check_test_img + +# success, all done +echo "*** done" +status=3D0 diff --git a/tests/qemu-iotests/201.out b/tests/qemu-iotests/201.out new file mode 100644 index 0000000000..9faf06f996 --- /dev/null +++ b/tests/qemu-iotests/201.out @@ -0,0 +1,23 @@ +QA output created by 201 +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 + +=3D=3D=3D Starting VMs =3D=3D=3D + + +=3D=3D=3D Set 'migrate_set_capability postcopy-ram on' and migrate =3D=3D= =3D + + +=3D=3D=3D Check if migration was successful =3D=3D=3D + + +=3D=3D=3D On destination, execute savevm and loadvm =3D=3D=3D + +(qemu) savevm state1 +(qemu) loadvm state1 + +=3D=3D=3D Shut down and check image =3D=3D=3D + +(qemu) quit +(qemu) quit +No errors were found on the image. +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 93d96fb22f..c4703cd782 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -197,5 +197,6 @@ 197 rw auto quick 198 rw auto 200 rw auto +201 rw auto migration 202 rw auto quick 203 rw auto --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716324332206.57399709105948; Tue, 23 Jan 2018 06:05:24 -0800 (PST) Received: from localhost ([::1]:59711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzCV-0005JI-Hl for importer@patchew.org; Tue, 23 Jan 2018 09:05:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9g-0003PF-90 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9a-0005lR-BY for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46976) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9T-0005f9-7X; Tue, 23 Jan 2018 09:02:15 -0500 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 513DB3577; Tue, 23 Jan 2018 14:02:14 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42B60BAAF; Tue, 23 Jan 2018 14:02:13 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:37 +0100 Message-Id: <20180123140201.31163-6-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.30]); Tue, 23 Jan 2018 14:02:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/29] qcow2: Repair unaligned preallocated zero clusters X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz We can easily repair unaligned preallocated zero clusters by discarding them, so why not do it? Signed-off-by: Max Reitz Message-id: 20171110203759.14018-2-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 70 ++++++++++++++++++++++++++++++++++++++----= ---- tests/qemu-iotests/060 | 3 +- tests/qemu-iotests/060.out | 9 ++++++ 3 files changed, 69 insertions(+), 13 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 3de1ab51ba..92701ab7af 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1508,7 +1508,7 @@ enum { static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res, void **refcount_table, int64_t *refcount_table_size, int64_t l2_off= set, - int flags) + int flags, BdrvCheckMode fix) { BDRVQcow2State *s =3D bs->opaque; uint64_t *l2_table, l2_entry; @@ -1579,6 +1579,57 @@ static int check_refcounts_l2(BlockDriverState *bs, = BdrvCheckResult *res, next_contiguous_offset =3D offset + s->cluster_size; } =20 + /* Correct offsets are cluster aligned */ + if (offset_into_cluster(s, offset)) { + if (qcow2_get_cluster_type(l2_entry) =3D=3D + QCOW2_CLUSTER_ZERO_ALLOC) + { + fprintf(stderr, "%s offset=3D%" PRIx64 ": Preallocated= zero " + "cluster is not properly aligned; L2 entry " + "corrupted.\n", + fix & BDRV_FIX_ERRORS ? "Repairing" : "ERROR", + offset); + if (fix & BDRV_FIX_ERRORS) { + uint64_t l2e_offset =3D + l2_offset + (uint64_t)i * sizeof(uint64_t); + + l2_entry =3D QCOW_OFLAG_ZERO; + l2_table[i] =3D cpu_to_be64(l2_entry); + ret =3D qcow2_pre_write_overlap_check(bs, + QCOW2_OL_ACTIVE_L2 | QCOW2_OL_INACTIVE_L2, + l2e_offset, sizeof(uint64_t)); + if (ret < 0) { + fprintf(stderr, "ERROR: Overlap check failed\n= "); + res->check_errors++; + /* Something is seriously wrong, so abort chec= king + * this L2 table */ + goto fail; + } + + ret =3D bdrv_pwrite_sync(bs->file, l2e_offset, + &l2_table[i], sizeof(uint64= _t)); + if (ret < 0) { + fprintf(stderr, "ERROR: Failed to overwrite L2= " + "table entry: %s\n", strerror(-ret)); + res->check_errors++; + /* Do not abort, continue checking the rest of= this + * L2 table's entries */ + } else { + res->corruptions_fixed++; + /* Skip marking the cluster as used + * (it is unused now) */ + continue; + } + } else { + res->corruptions++; + } + } else { + fprintf(stderr, "ERROR offset=3D%" PRIx64 ": Data clus= ter is " + "not properly aligned; L2 entry corrupted.\n", off= set); + res->corruptions++; + } + } + /* Mark cluster as used */ ret =3D qcow2_inc_refcounts_imrt(bs, res, refcount_table, refcount_table_= size, @@ -1586,13 +1637,6 @@ static int check_refcounts_l2(BlockDriverState *bs, = BdrvCheckResult *res, if (ret < 0) { goto fail; } - - /* Correct offsets are cluster aligned */ - if (offset_into_cluster(s, offset)) { - fprintf(stderr, "ERROR offset=3D%" PRIx64 ": Cluster is no= t " - "properly aligned; L2 entry corrupted.\n", offset); - res->corruptions++; - } break; } =20 @@ -1626,7 +1670,7 @@ static int check_refcounts_l1(BlockDriverState *bs, void **refcount_table, int64_t *refcount_table_size, int64_t l1_table_offset, int l1_size, - int flags) + int flags, BdrvCheckMode fix) { BDRVQcow2State *s =3D bs->opaque; uint64_t *l1_table =3D NULL, l2_offset, l1_size2; @@ -1681,7 +1725,8 @@ static int check_refcounts_l1(BlockDriverState *bs, =20 /* Process and check L2 entries */ ret =3D check_refcounts_l2(bs, res, refcount_table, - refcount_table_size, l2_offset, flags= ); + refcount_table_size, l2_offset, flags, + fix); if (ret < 0) { goto fail; } @@ -1957,7 +2002,8 @@ static int calculate_refcounts(BlockDriverState *bs, = BdrvCheckResult *res, =20 /* current L1 table */ ret =3D check_refcounts_l1(bs, res, refcount_table, nb_clusters, - s->l1_table_offset, s->l1_size, CHECK_FRAG_IN= FO); + s->l1_table_offset, s->l1_size, CHECK_FRAG_IN= FO, + fix); if (ret < 0) { return ret; } @@ -1966,7 +2012,7 @@ static int calculate_refcounts(BlockDriverState *bs, = BdrvCheckResult *res, for (i =3D 0; i < s->nb_snapshots; i++) { sn =3D s->snapshots + i; ret =3D check_refcounts_l1(bs, res, refcount_table, nb_clusters, - sn->l1_table_offset, sn->l1_size, 0); + sn->l1_table_offset, sn->l1_size, 0, fix); if (ret < 0) { return ret; } diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index 14797dd3b0..6c7407f499 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -335,7 +335,8 @@ poke_file "$TEST_IMG" "$l2_offset" "\x80\x00\x00\x00\x0= 0\x00\x2a\x01" # Let's write to it! $QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io =20 -# Can't repair this yet (TODO: We can just deallocate the cluster) +echo '--- Repairing ---' +_check_test_img -r all =20 echo echo '=3D=3D=3D Discarding with an unaligned refblock =3D=3D=3D' diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out index c4cb7c665e..25d5c3938b 100644 --- a/tests/qemu-iotests/060.out +++ b/tests/qemu-iotests/060.out @@ -317,6 +317,15 @@ discard 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) qcow2: Marking image as corrupt: Preallocated zero cluster offset 0x2a00 u= naligned (guest offset: 0); further corruption events will be suppressed write failed: Input/output error +--- Repairing --- +Repairing offset=3D2a00: Preallocated zero cluster is not properly aligned= ; L2 entry corrupted. +The following inconsistencies were found and repaired: + + 0 leaked clusters + 1 corruptions + +Double checking the fixed image now... +No errors were found on the image. =20 =3D=3D=3D Discarding with an unaligned refblock =3D=3D=3D =20 --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716345118328.49327434788415; Tue, 23 Jan 2018 06:05:45 -0800 (PST) Received: from localhost ([::1]:59713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzCq-0005aW-7c for importer@patchew.org; Tue, 23 Jan 2018 09:05:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9r-0003a4-LO for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9k-0005sp-Sv for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40124) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9U-0005fu-Ka; Tue, 23 Jan 2018 09:02:16 -0500 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 BAC557A171; Tue, 23 Jan 2018 14:02:15 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C8F6BA9D; Tue, 23 Jan 2018 14:02:14 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:38 +0100 Message-Id: <20180123140201.31163-7-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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]); Tue, 23 Jan 2018 14:02:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz In some cases, these commands still use the deprecated @device parameter. Fix that so we can later drop that parameter from their interface. Signed-off-by: Max Reitz Message-id: 20171110224302.14424-2-mreitz@redhat.com Reviewed-by: Alberto Garcia Signed-off-by: Max Reitz --- tests/qemu-iotests/118 | 184 +++++++++++++++++++++++----------------------= ---- tests/qemu-iotests/155 | 60 ++++++++-------- 2 files changed, 113 insertions(+), 131 deletions(-) diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118 index 8a9e838c90..ca6965d23c 100755 --- a/tests/qemu-iotests/118 +++ b/tests/qemu-iotests/118 @@ -28,6 +28,14 @@ from iotests import qemu_img old_img =3D os.path.join(iotests.test_dir, 'test0.img') new_img =3D os.path.join(iotests.test_dir, 'test1.img') =20 +def interface_to_device_name(interface): + if interface =3D=3D 'ide': + return 'ide-cd' + elif interface =3D=3D 'floppy': + return 'floppy' + else: + return None + class ChangeBaseClass(iotests.QMPTestCase): has_opened =3D False has_closed =3D False @@ -63,7 +71,7 @@ class ChangeBaseClass(iotests.QMPTestCase): =20 class GeneralChangeTestsBaseClass(ChangeBaseClass): =20 - device_name =3D None + device_name =3D 'qdev0' =20 def test_change(self): result =3D self.vm.qmp('change', device=3D'drive0', target=3Dnew_i= mg, @@ -79,14 +87,9 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_blockdev_change_medium(self): - if self.device_name is not None: - result =3D self.vm.qmp('blockdev-change-medium', - id=3Dself.device_name, filename=3Dnew_img, - format=3Diotests.imgfmt) - else: - result =3D self.vm.qmp('blockdev-change-medium', - device=3D'drive0', filename=3Dnew_img, - format=3Diotests.imgfmt) + result =3D self.vm.qmp('blockdev-change-medium', + id=3Dself.device_name, filename=3Dnew_img, + format=3Diotests.imgfmt) =20 self.assert_qmp(result, 'return', {}) =20 @@ -99,10 +102,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_eject(self): - if self.device_name is not None: - result =3D self.vm.qmp('eject', id=3Dself.device_name, force= =3DTrue) - else: - result =3D self.vm.qmp('eject', device=3D'drive0', force=3DTru= e) + result =3D self.vm.qmp('eject', id=3Dself.device_name, force=3DTru= e) self.assert_qmp(result, 'return', {}) =20 self.wait_for_open() @@ -113,10 +113,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp_absent(result, 'return[0]/inserted') =20 def test_tray_eject_change(self): - if self.device_name is not None: - result =3D self.vm.qmp('eject', id=3Dself.device_name, force= =3DTrue) - else: - result =3D self.vm.qmp('eject', device=3D'drive0', force=3DTru= e) + result =3D self.vm.qmp('eject', id=3Dself.device_name, force=3DTru= e) self.assert_qmp(result, 'return', {}) =20 self.wait_for_open() @@ -126,12 +123,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') =20 - if self.device_name is not None: - result =3D self.vm.qmp('blockdev-change-medium', id=3Dself.dev= ice_name, - filename=3Dnew_img, format=3Diotests.imgf= mt) - else: - result =3D self.vm.qmp('blockdev-change-medium', device=3D'dri= ve0', - filename=3Dnew_img, format=3Diotests.imgf= mt) + result =3D self.vm.qmp('blockdev-change-medium', id=3Dself.device_= name, + filename=3Dnew_img, format=3Diotests.imgfmt) self.assert_qmp(result, 'return', {}) =20 self.wait_for_close() @@ -142,12 +135,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_tray_open_close(self): - if self.device_name is not None: - result =3D self.vm.qmp('blockdev-open-tray', - id=3Dself.device_name, force=3DTrue) - else: - result =3D self.vm.qmp('blockdev-open-tray', - device=3D'drive0', force=3DTrue) + result =3D self.vm.qmp('blockdev-open-tray', + id=3Dself.device_name, force=3DTrue) self.assert_qmp(result, 'return', {}) =20 self.wait_for_open() @@ -160,10 +149,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): else: self.assert_qmp(result, 'return[0]/inserted/image/filename', o= ld_img) =20 - if self.device_name is not None: - result =3D self.vm.qmp('blockdev-close-tray', id=3Dself.device= _name) - else: - result =3D self.vm.qmp('blockdev-close-tray', device=3D'drive0= ') + result =3D self.vm.qmp('blockdev-close-tray', id=3Dself.device_nam= e) self.assert_qmp(result, 'return', {}) =20 if self.has_real_tray or not self.was_empty: @@ -178,7 +164,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', o= ld_img) =20 def test_tray_eject_close(self): - result =3D self.vm.qmp('eject', device=3D'drive0', force=3DTrue) + result =3D self.vm.qmp('eject', id=3Dself.device_name, force=3DTru= e) self.assert_qmp(result, 'return', {}) =20 self.wait_for_open() @@ -188,10 +174,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') =20 - if self.device_name is not None: - result =3D self.vm.qmp('blockdev-close-tray', id=3Dself.device= _name) - else: - result =3D self.vm.qmp('blockdev-close-tray', device=3D'drive0= ') + result =3D self.vm.qmp('blockdev-close-tray', id=3Dself.device_nam= e) self.assert_qmp(result, 'return', {}) =20 self.wait_for_close() @@ -202,7 +185,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp_absent(result, 'return[0]/inserted') =20 def test_tray_open_change(self): - result =3D self.vm.qmp('blockdev-open-tray', device=3D'drive0', fo= rce=3DTrue) + result =3D self.vm.qmp('blockdev-open-tray', id=3Dself.device_name, + force=3DTrue) self.assert_qmp(result, 'return', {}) =20 self.wait_for_open() @@ -215,7 +199,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): else: self.assert_qmp(result, 'return[0]/inserted/image/filename', o= ld_img) =20 - result =3D self.vm.qmp('blockdev-change-medium', device=3D'drive0', + result =3D self.vm.qmp('blockdev-change-medium', id=3Dself.device_= name, filename=3Dnew_img, format=3Diotests.im= gfmt) self.assert_qmp(result, 'return', {}) @@ -235,12 +219,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): 'driver': 'file'}) self.assert_qmp(result, 'return', {}) =20 - if self.device_name is not None: - result =3D self.vm.qmp('blockdev-open-tray', - id=3Dself.device_name, force=3DTrue) - else: - result =3D self.vm.qmp('blockdev-open-tray', - device=3D'drive0', force=3DTrue) + result =3D self.vm.qmp('blockdev-open-tray', + id=3Dself.device_name, force=3DTrue) self.assert_qmp(result, 'return', {}) =20 self.wait_for_open() @@ -253,11 +233,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): else: self.assert_qmp(result, 'return[0]/inserted/image/filename', o= ld_img) =20 - if self.device_name is not None: - result =3D self.vm.qmp('x-blockdev-remove-medium', - id=3Dself.device_name) - else: - result =3D self.vm.qmp('x-blockdev-remove-medium', device=3D'd= rive0') + result =3D self.vm.qmp('x-blockdev-remove-medium', + id=3Dself.device_name) self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') @@ -265,12 +242,8 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') =20 - if self.device_name is not None: - result =3D self.vm.qmp('x-blockdev-insert-medium', - id=3Dself.device_name, node_name=3D'new') - else: - result =3D self.vm.qmp('x-blockdev-insert-medium', - device=3D'drive0', node_name=3D'new') + result =3D self.vm.qmp('x-blockdev-insert-medium', + id=3Dself.device_name, node_name=3D'new') self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') @@ -278,10 +251,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 - if self.device_name is not None: - result =3D self.vm.qmp('blockdev-close-tray', id=3Dself.device= _name) - else: - result =3D self.vm.qmp('blockdev-close-tray', device=3D'drive0= ') + result =3D self.vm.qmp('blockdev-close-tray', id=3Dself.device_nam= e) self.assert_qmp(result, 'return', {}) =20 self.wait_for_close() @@ -292,7 +262,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_close_on_closed(self): - result =3D self.vm.qmp('blockdev-close-tray', device=3D'drive0') + result =3D self.vm.qmp('blockdev-close-tray', id=3Dself.device_nam= e) # Should be a no-op self.assert_qmp(result, 'return', {}) self.assertEquals(self.vm.get_qmp_events(wait=3DFalse), []) @@ -301,7 +271,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): if not self.has_real_tray: return =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', device=3D'drive= 0') + result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) self.assert_qmp(result, 'error/class', 'GenericError') =20 def test_insert_on_closed(self): @@ -315,7 +285,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): 'driver': 'file'}) self.assert_qmp(result, 'return', {}) =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', device=3D'drive= 0', + result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, node_name=3D'new') self.assert_qmp(result, 'error/class', 'GenericError') =20 @@ -326,12 +296,10 @@ class TestInitiallyFilled(GeneralChangeTestsBaseClass= ): qemu_img('create', '-f', iotests.imgfmt, old_img, '1440k') qemu_img('create', '-f', iotests.imgfmt, new_img, '1440k') self.vm =3D iotests.VM() - if interface =3D=3D 'ide': - self.device_name =3D 'qdev0' - self.vm.add_drive(old_img, 'media=3D%s' % media, 'none') - self.vm.add_device('ide-cd,drive=3Ddrive0,id=3D%s' % self.devi= ce_name) - else: - self.vm.add_drive(old_img, 'media=3D%s' % media, interface) + self.vm.add_drive(old_img, 'media=3D%s' % media, 'none') + self.vm.add_device('%s,drive=3Ddrive0,id=3D%s' % + (interface_to_device_name(interface), + self.device_name)) self.vm.launch() =20 def tearDown(self): @@ -347,12 +315,12 @@ class TestInitiallyFilled(GeneralChangeTestsBaseClass= ): 'driver': 'file'}) self.assert_qmp(result, 'return', {}) =20 - result =3D self.vm.qmp('blockdev-open-tray', device=3D'drive0') + result =3D self.vm.qmp('blockdev-open-tray', id=3Dself.device_name) self.assert_qmp(result, 'return', {}) =20 self.wait_for_open() =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', device=3D'drive= 0', + result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, node_name=3D'new') self.assert_qmp(result, 'error/class', 'GenericError') =20 @@ -361,7 +329,10 @@ class TestInitiallyEmpty(GeneralChangeTestsBaseClass): =20 def setUp(self, media, interface): qemu_img('create', '-f', iotests.imgfmt, new_img, '1440k') - self.vm =3D iotests.VM().add_drive(None, 'media=3D%s' % media, int= erface) + self.vm =3D iotests.VM().add_drive(None, 'media=3D%s' % media, 'no= ne') + self.vm.add_device('%s,drive=3Ddrive0,id=3D%s' % + (interface_to_device_name(interface), + self.device_name)) self.vm.launch() =20 def tearDown(self): @@ -369,12 +340,12 @@ class TestInitiallyEmpty(GeneralChangeTestsBaseClass): os.remove(new_img) =20 def test_remove_on_empty(self): - result =3D self.vm.qmp('blockdev-open-tray', device=3D'drive0') + result =3D self.vm.qmp('blockdev-open-tray', id=3Dself.device_name) self.assert_qmp(result, 'return', {}) =20 self.wait_for_open() =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', device=3D'drive= 0') + result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) # Should be a no-op self.assert_qmp(result, 'return', {}) =20 @@ -410,6 +381,8 @@ class TestFloppyInitiallyEmpty(TestInitiallyEmpty): self.has_opened =3D True =20 class TestChangeReadOnly(ChangeBaseClass): + device_name =3D 'qdev0' + def setUp(self): qemu_img('create', '-f', iotests.imgfmt, old_img, '1440k') qemu_img('create', '-f', iotests.imgfmt, new_img, '1440k') @@ -425,14 +398,15 @@ class TestChangeReadOnly(ChangeBaseClass): def test_ro_ro_retain(self): os.chmod(old_img, 0444) os.chmod(new_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 - result =3D self.vm.qmp('blockdev-change-medium', device=3D'drive0', + result =3D self.vm.qmp('blockdev-change-medium', id=3Dself.device_= name, filename=3Dnew_img, format=3Diotests.im= gfmt, read_only_mode=3D'r= etain') @@ -444,14 +418,15 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def test_ro_rw_retain(self): os.chmod(old_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 - result =3D self.vm.qmp('blockdev-change-medium', device=3D'drive0', + result =3D self.vm.qmp('blockdev-change-medium', id=3Dself.device_= name, filename=3Dnew_img, format=3Diotests.im= gfmt, read_only_mode=3D'r= etain') @@ -463,14 +438,15 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def test_rw_ro_retain(self): os.chmod(new_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 - result =3D self.vm.qmp('blockdev-change-medium', device=3D'drive0', + result =3D self.vm.qmp('blockdev-change-medium', id=3Dself.device_= name, filename=3Dnew_img, format=3Diotests.im= gfmt, read_only_mode=3D'r= etain') @@ -484,7 +460,8 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def test_ro_rw(self): os.chmod(old_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') @@ -492,7 +469,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 result =3D self.vm.qmp('blockdev-change-medium', - device=3D'drive0', + id=3Dself.device_name, filename=3Dnew_img, format=3Diotests.imgfmt, read_only_mode=3D'read-write') @@ -504,7 +481,8 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def test_rw_ro(self): os.chmod(new_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') @@ -512,7 +490,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 result =3D self.vm.qmp('blockdev-change-medium', - device=3D'drive0', + id=3Dself.device_name, filename=3Dnew_img, format=3Diotests.imgfmt, read_only_mode=3D'read-only') @@ -523,7 +501,8 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_make_rw_ro(self): - self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') @@ -531,7 +510,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 result =3D self.vm.qmp('blockdev-change-medium', - device=3D'drive0', + id=3Dself.device_name, filename=3Dnew_img, format=3Diotests.imgfmt, read_only_mode=3D'read-only') @@ -543,7 +522,8 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def test_make_ro_rw(self): os.chmod(new_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') @@ -551,7 +531,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 result =3D self.vm.qmp('blockdev-change-medium', - device=3D'drive0', + id=3Dself.device_name, filename=3Dnew_img, format=3Diotests.imgfmt, read_only_mode=3D'read-write') @@ -563,14 +543,15 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def test_make_rw_ro_by_retain(self): os.chmod(old_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') self.assert_qmp(result, 'return[0]/inserted/ro', True) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 - result =3D self.vm.qmp('blockdev-change-medium', device=3D'drive0', + result =3D self.vm.qmp('blockdev-change-medium', id=3Dself.device_= name, filename=3Dnew_img, format=3Diotests.im= gfmt, read_only_mode=3D'r= etain') @@ -582,14 +563,15 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def test_make_ro_rw_by_retain(self): os.chmod(new_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 - result =3D self.vm.qmp('blockdev-change-medium', device=3D'drive0', + result =3D self.vm.qmp('blockdev-change-medium', id=3Dself.device_= name, filename=3Dnew_img, format=3Diotests.im= gfmt, read_only_mode=3D'r= etain') @@ -601,7 +583,8 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def test_rw_ro_cycle(self): os.chmod(new_img, 0444) - self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') + self.vm.add_drive(old_img, 'media=3Ddisk', 'none') + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') @@ -620,13 +603,13 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', device=3D'drive= 0') + result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') self.assert_qmp_absent(result, 'return[0]/inserted') =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', device=3D'drive= 0', + result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, node_name=3D'new') self.assert_qmp(result, 'return', {}) =20 @@ -644,11 +627,14 @@ TestInitiallyEmpty =3D None =20 =20 class TestBlockJobsAfterCycle(ChangeBaseClass): + device_name =3D 'qdev0' + def setUp(self): - qemu_img('create', '-f', iotests.imgfmt, old_img, '1M') + qemu_img('create', '-f', iotests.imgfmt, old_img, '1440K') =20 self.vm =3D iotests.VM() self.vm.add_drive_raw("id=3Ddrive0,driver=3Dnull-co,if=3Dnone") + self.vm.add_device('floppy,drive=3Ddrive0,id=3D%s' % self.device_n= ame) self.vm.launch() =20 result =3D self.vm.qmp('query-block') @@ -656,7 +642,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass): =20 # For device-less BBs, calling blockdev-open-tray or blockdev-clos= e-tray # is not necessary - result =3D self.vm.qmp('x-blockdev-remove-medium', device=3D'drive= 0') + result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') @@ -669,7 +655,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass): 'driver': 'file'}) self.assert_qmp(result, 'return', {}) =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', device=3D'drive= 0', + result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, node_name=3D'node0') self.assert_qmp(result, 'return', {}) =20 diff --git a/tests/qemu-iotests/155 b/tests/qemu-iotests/155 index 0b86ea4e5c..fc9fa975be 100755 --- a/tests/qemu-iotests/155 +++ b/tests/qemu-iotests/155 @@ -51,36 +51,30 @@ class BaseClass(iotests.QMPTestCase): target_real_backing =3D None =20 def setUp(self): - qemu_img('create', '-f', iotests.imgfmt, back0_img, '1M') + qemu_img('create', '-f', iotests.imgfmt, back0_img, '1440K') qemu_img('create', '-f', iotests.imgfmt, '-b', back0_img, back1_im= g) qemu_img('create', '-f', iotests.imgfmt, '-b', back1_img, back2_im= g) qemu_img('create', '-f', iotests.imgfmt, '-b', back2_img, source_i= mg) =20 self.vm =3D iotests.VM() - self.vm.add_drive(None, '', 'none') - self.vm.launch() - # Add the BDS via blockdev-add so it stays around after the mirror= block # job has been completed - result =3D self.vm.qmp('blockdev-add', - node_name=3D'source', - driver=3Diotests.imgfmt, - file=3D{'driver': 'file', - 'filename': source_img}) - self.assert_qmp(result, 'return', {}) - - result =3D self.vm.qmp('x-blockdev-insert-medium', - device=3D'drive0', node_name=3D'source') - self.assert_qmp(result, 'return', {}) + blockdev =3D {'node-name': 'source', + 'driver': iotests.imgfmt, + 'file': {'driver': 'file', + 'filename': source_img}} + self.vm.add_blockdev(self.qmp_to_opts(blockdev)) + self.vm.add_device('floppy,id=3Dqdev0,drive=3Dsource') + self.vm.launch() =20 self.assertIntactSourceBackingChain() =20 if self.existing: if self.target_backing: qemu_img('create', '-f', iotests.imgfmt, - '-b', self.target_backing, target_img, '1M') + '-b', self.target_backing, target_img, '1440K') else: - qemu_img('create', '-f', iotests.imgfmt, target_img, '1M') + qemu_img('create', '-f', iotests.imgfmt, target_img, '1440= K') =20 if self.cmd =3D=3D 'blockdev-mirror': options =3D { 'node-name': 'target', @@ -104,11 +98,11 @@ class BaseClass(iotests.QMPTestCase): except OSError: pass =20 - def findBlockNode(self, node_name, id=3DNone): - if id: + def findBlockNode(self, node_name, qdev=3DNone): + if qdev: result =3D self.vm.qmp('query-block') for device in result['return']: - if device['device'] =3D=3D id: + if device['qdev'] =3D=3D qdev: if node_name: self.assert_qmp(device, 'inserted/node-name', node= _name) return device['inserted'] @@ -118,7 +112,7 @@ class BaseClass(iotests.QMPTestCase): if node['node-name'] =3D=3D node_name: return node =20 - self.fail('Cannot find node %s/%s' % (id, node_name)) + self.fail('Cannot find node %s/%s' % (qdev, node_name)) =20 def assertIntactSourceBackingChain(self): node =3D self.findBlockNode('source') @@ -155,22 +149,23 @@ class BaseClass(iotests.QMPTestCase): class MirrorBaseClass(BaseClass): def runMirror(self, sync): if self.cmd =3D=3D 'blockdev-mirror': - result =3D self.vm.qmp(self.cmd, device=3D'drive0', sync=3Dsyn= c, - target=3D'target') + result =3D self.vm.qmp(self.cmd, job_id=3D'mirror-job', device= =3D'source', + sync=3Dsync, target=3D'target') else: if self.existing: mode =3D 'existing' else: mode =3D 'absolute-paths' - result =3D self.vm.qmp(self.cmd, device=3D'drive0', sync=3Dsyn= c, - target=3Dtarget_img, format=3Diotests.img= fmt, - mode=3Dmode, node_name=3D'target') + result =3D self.vm.qmp(self.cmd, job_id=3D'mirror-job', device= =3D'source', + sync=3Dsync, target=3Dtarget_img, + format=3Diotests.imgfmt, mode=3Dmode, + node_name=3D'target') =20 self.assert_qmp(result, 'return', {}) =20 self.vm.event_wait('BLOCK_JOB_READY') =20 - result =3D self.vm.qmp('block-job-complete', device=3D'drive0') + result =3D self.vm.qmp('block-job-complete', device=3D'mirror-job') self.assert_qmp(result, 'return', {}) =20 self.vm.event_wait('BLOCK_JOB_COMPLETED') @@ -178,21 +173,21 @@ class MirrorBaseClass(BaseClass): def testFull(self): self.runMirror('full') =20 - node =3D self.findBlockNode('target', 'drive0') + node =3D self.findBlockNode('target', 'qdev0') self.assertCorrectBackingImage(node, None) self.assertIntactSourceBackingChain() =20 def testTop(self): self.runMirror('top') =20 - node =3D self.findBlockNode('target', 'drive0') + node =3D self.findBlockNode('target', 'qdev0') self.assertCorrectBackingImage(node, back2_img) self.assertIntactSourceBackingChain() =20 def testNone(self): self.runMirror('none') =20 - node =3D self.findBlockNode('target', 'drive0') + node =3D self.findBlockNode('target', 'qdev0') self.assertCorrectBackingImage(node, source_img) self.assertIntactSourceBackingChain() =20 @@ -233,17 +228,18 @@ class TestCommit(BaseClass): existing =3D False =20 def testCommit(self): - result =3D self.vm.qmp('block-commit', device=3D'drive0', base=3Db= ack1_img) + result =3D self.vm.qmp('block-commit', job_id=3D'commit-job', + device=3D'source', base=3Dback1_img) self.assert_qmp(result, 'return', {}) =20 self.vm.event_wait('BLOCK_JOB_READY') =20 - result =3D self.vm.qmp('block-job-complete', device=3D'drive0') + result =3D self.vm.qmp('block-job-complete', device=3D'commit-job') self.assert_qmp(result, 'return', {}) =20 self.vm.event_wait('BLOCK_JOB_COMPLETED') =20 - node =3D self.findBlockNode(None, 'drive0') + node =3D self.findBlockNode(None, 'qdev0') self.assert_qmp(node, 'image' + '/backing-image' * 0 + '/filename', back1_img) self.assert_qmp(node, 'image' + '/backing-image' * 1 + '/filename', --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716519829454.00680891756735; Tue, 23 Jan 2018 06:08:39 -0800 (PST) Received: from localhost ([::1]:59741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzFf-00083j-28 for importer@patchew.org; Tue, 23 Jan 2018 09:08:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9o-0003WQ-OZ for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9k-0005sf-Se for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57290) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9V-0005hK-Rn; Tue, 23 Jan 2018 09:02:17 -0500 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 01D7FC09943B; Tue, 23 Jan 2018 14:02:17 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F5C08517; Tue, 23 Jan 2018 14:02:15 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:39 +0100 Message-Id: <20180123140201.31163-8-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.31]); Tue, 23 Jan 2018 14:02:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/29] tests/ahci: Switch tray and medium commands to @id X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Currently, the tray and medium commands in the AHCI test use the deprecated @device parameter. This patch switches all invocations over to use @id. Signed-off-by: Max Reitz Message-id: 20171110224302.14424-3-mreitz@redhat.com Reviewed-by: Alberto Garcia Signed-off-by: Max Reitz --- tests/ahci-test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index cb84edc8fb..3635ea6d41 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1578,9 +1578,9 @@ static void test_atapi_tray(void) QDict *rsp; =20 fd =3D prepare_iso(iso_size, &tx, &iso); - ahci =3D ahci_boot_and_enable("-drive if=3Dnone,id=3Ddrive0,file=3D%s,= format=3Draw " + ahci =3D ahci_boot_and_enable("-blockdev node-name=3Ddrive0,driver=3Df= ile,filename=3D%s " "-M q35 " - "-device ide-cd,drive=3Ddrive0 ", iso); + "-device ide-cd,id=3Dcd0,drive=3Ddrive0 ",= iso); port =3D ahci_port_select(ahci); =20 ahci_atapi_eject(ahci, port); @@ -1591,13 +1591,13 @@ static void test_atapi_tray(void) =20 /* Remove media */ qmp_async("{'execute': 'blockdev-open-tray', " - "'arguments': {'device': 'drive0'}}"); + "'arguments': {'id': 'cd0'}}"); atapi_wait_tray(true); rsp =3D qmp_receive(); QDECREF(rsp); =20 qmp_discard_response("{'execute': 'x-blockdev-remove-medium', " - "'arguments': {'device': 'drive0'}}"); + "'arguments': {'id': 'cd0'}}"); =20 /* Test the tray without a medium */ ahci_atapi_load(ahci, port); @@ -1613,12 +1613,12 @@ static void test_atapi_tray(void) "'file': { 'driver': 'file', " "'filename': %s }}}", is= o); qmp_discard_response("{'execute': 'x-blockdev-insert-medium'," - "'arguments': { 'device': 'drive0', " + "'arguments': { 'id': 'cd0', " "'node-name': 'node0' }}"); =20 /* Again, the event shows up first */ qmp_async("{'execute': 'blockdev-close-tray', " - "'arguments': {'device': 'drive0'}}"); + "'arguments': {'id': 'cd0'}}"); atapi_wait_tray(false); rsp =3D qmp_receive(); QDECREF(rsp); --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716505318736.1780517250098; Tue, 23 Jan 2018 06:08:25 -0800 (PST) Received: from localhost ([::1]:59740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzFQ-0007ms-Ec for importer@patchew.org; Tue, 23 Jan 2018 09:08:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9g-0003Pd-FZ for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9f-0005oh-6a for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57330) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9X-0005in-8e; Tue, 23 Jan 2018 09:02:19 -0500 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 52FFCC099446; Tue, 23 Jan 2018 14:02:18 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51DE8BA79; Tue, 23 Jan 2018 14:02:17 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:40 +0100 Message-Id: <20180123140201.31163-9-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.31]); Tue, 23 Jan 2018 14:02:18 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/29] blockdev: Drop BD-{remove, insert}-medium's @device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz This is an incompatible change, which is fine as the commands are experimental. Signed-off-by: Max Reitz Message-id: 20171110224302.14424-4-mreitz@redhat.com Reviewed-by: Alberto Garcia Signed-off-by: Max Reitz --- qapi/block-core.json | 10 ++-------- blockdev.c | 30 +++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index e94a6881b2..d1df47de26 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3411,8 +3411,6 @@ # # If the tray is open and there is no medium inserted, this will be a no-o= p. # -# @device: Block device name (deprecated, use @id instead) -# # @id: The name or QOM path of the guest device (since: 2.8) # # Note: This command is still a work in progress and is considered experim= ental. @@ -3447,8 +3445,7 @@ # ## { 'command': 'x-blockdev-remove-medium', - 'data': { '*device': 'str', - '*id': 'str' } } + 'data': { 'id': 'str' } } =20 ## # @x-blockdev-insert-medium: @@ -3457,8 +3454,6 @@ # device's tray must currently be open (unless there is no attached guest # device) and there must be no medium inserted already. # -# @device: Block device name (deprecated, use @id instead) -# # @id: The name or QOM path of the guest device (since: 2.8) # # @node-name: name of a node in the block driver state graph @@ -3486,8 +3481,7 @@ # ## { 'command': 'x-blockdev-insert-medium', - 'data': { '*device': 'str', - '*id': 'str', + 'data': { 'id': 'str', 'node-name': 'str'} } =20 =20 diff --git a/blockdev.c b/blockdev.c index 29d569a24e..2f9aef4167 100644 --- a/blockdev.c +++ b/blockdev.c @@ -60,6 +60,11 @@ static QTAILQ_HEAD(, BlockDriverState) monitor_bdrv_stat= es =3D =20 static int do_open_tray(const char *blk_name, const char *qdev_id, bool force, Error **errp); +static void blockdev_remove_medium(bool has_device, const char *device, + bool has_id, const char *id, Error **er= rp); +static void blockdev_insert_medium(bool has_device, const char *device, + bool has_id, const char *id, + const char *node_name, Error **errp); =20 static const char *const if_name[IF_COUNT] =3D { [IF_NONE] =3D "none", @@ -2323,7 +2328,7 @@ void qmp_eject(bool has_device, const char *device, } error_free(local_err); =20 - qmp_x_blockdev_remove_medium(has_device, device, has_id, id, errp); + blockdev_remove_medium(has_device, device, has_id, id, errp); } =20 void qmp_block_passwd(bool has_device, const char *device, @@ -2446,8 +2451,8 @@ void qmp_blockdev_close_tray(bool has_device, const c= har *device, } } =20 -void qmp_x_blockdev_remove_medium(bool has_device, const char *device, - bool has_id, const char *id, Error **err= p) +static void blockdev_remove_medium(bool has_device, const char *device, + bool has_id, const char *id, Error **er= rp) { BlockBackend *blk; BlockDriverState *bs; @@ -2503,6 +2508,11 @@ out: aio_context_release(aio_context); } =20 +void qmp_x_blockdev_remove_medium(const char *id, Error **errp) +{ + blockdev_remove_medium(false, NULL, true, id, errp); +} + static void qmp_blockdev_insert_anon_medium(BlockBackend *blk, BlockDriverState *bs, Error **= errp) { @@ -2548,9 +2558,9 @@ static void qmp_blockdev_insert_anon_medium(BlockBack= end *blk, } } =20 -void qmp_x_blockdev_insert_medium(bool has_device, const char *device, - bool has_id, const char *id, - const char *node_name, Error **errp) +static void blockdev_insert_medium(bool has_device, const char *device, + bool has_id, const char *id, + const char *node_name, Error **errp) { BlockBackend *blk; BlockDriverState *bs; @@ -2576,6 +2586,12 @@ void qmp_x_blockdev_insert_medium(bool has_device, c= onst char *device, qmp_blockdev_insert_anon_medium(blk, bs, errp); } =20 +void qmp_x_blockdev_insert_medium(const char *id, const char *node_name, + Error **errp) +{ + blockdev_insert_medium(false, NULL, true, id, node_name, errp); +} + void qmp_blockdev_change_medium(bool has_device, const char *device, bool has_id, const char *id, const char *filename, @@ -2650,7 +2666,7 @@ void qmp_blockdev_change_medium(bool has_device, cons= t char *device, error_free(err); err =3D NULL; =20 - qmp_x_blockdev_remove_medium(has_device, device, has_id, id, &err); + blockdev_remove_medium(has_device, device, has_id, id, &err); if (err) { error_propagate(errp, err); goto fail; --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717209037138.32390134463014; Tue, 23 Jan 2018 06:20:09 -0800 (PST) Received: from localhost ([::1]:60021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzQm-0001SW-6R for importer@patchew.org; Tue, 23 Jan 2018 09:20:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9w-0003dL-99 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9p-0005vY-J7 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46074) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9Y-0005jh-Ew; Tue, 23 Jan 2018 09:02:20 -0500 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 8A1BC7CB9C; Tue, 23 Jan 2018 14:02:19 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A24EBA79; Tue, 23 Jan 2018 14:02:18 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:41 +0100 Message-Id: <20180123140201.31163-10-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.26]); Tue, 23 Jan 2018 14:02:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/29] blockdev: Mark BD-{remove, insert}-medium stable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Now that iotest 093 test proves that the throttling configuration survives a blockdev-remove-medium/blockdev-insert-medium pair, the original reason for declaring these commands experimental is gone (see commit 6e0abc251dd4f8eba1f53656dfede12e5840e83b). Signed-off-by: Max Reitz Message-id: 20171110224302.14424-5-mreitz@redhat.com Reviewed-by: Alberto Garcia Signed-off-by: Max Reitz --- qapi/block-core.json | 32 +++++++++++++------------------- blockdev.c | 6 +++--- tests/ahci-test.c | 4 ++-- tests/qemu-iotests/093 | 6 +++--- tests/qemu-iotests/118 | 20 ++++++++++---------- tests/qemu-iotests/139 | 2 +- 6 files changed, 32 insertions(+), 38 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index d1df47de26..89ed2bc6a4 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3403,7 +3403,7 @@ '*id': 'str' } } =20 ## -# @x-blockdev-remove-medium: +# @blockdev-remove-medium: # # Removes a medium (a block driver state tree) from a block device. That b= lock # device's tray must currently be open (unless there is no attached guest @@ -3411,16 +3411,13 @@ # # If the tray is open and there is no medium inserted, this will be a no-o= p. # -# @id: The name or QOM path of the guest device (since: 2.8) -# -# Note: This command is still a work in progress and is considered experim= ental. -# Stay away from it unless you want to help with its development. +# @id: The name or QOM path of the guest device # -# Since: 2.5 +# Since: 2.12 # # Example: # -# -> { "execute": "x-blockdev-remove-medium", +# -> { "execute": "blockdev-remove-medium", # "arguments": { "id": "ide0-1-0" } } # # <- { "error": { "class": "GenericError", @@ -3438,30 +3435,27 @@ # # <- { "return": {} } # -# -> { "execute": "x-blockdev-remove-medium", +# -> { "execute": "blockdev-remove-medium", # "arguments": { "id": "ide0-1-0" } } # # <- { "return": {} } # ## -{ 'command': 'x-blockdev-remove-medium', +{ 'command': 'blockdev-remove-medium', 'data': { 'id': 'str' } } =20 ## -# @x-blockdev-insert-medium: +# @blockdev-insert-medium: # # Inserts a medium (a block driver state tree) into a block device. That b= lock # device's tray must currently be open (unless there is no attached guest # device) and there must be no medium inserted already. # -# @id: The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device # # @node-name: name of a node in the block driver state graph # -# Note: This command is still a work in progress and is considered experim= ental. -# Stay away from it unless you want to help with its development. -# -# Since: 2.5 +# Since: 2.12 # # Example: # @@ -3473,14 +3467,14 @@ # "filename": "fedora.iso" } } } # <- { "return": {} } # -# -> { "execute": "x-blockdev-insert-medium", +# -> { "execute": "blockdev-insert-medium", # "arguments": { "id": "ide0-1-0", # "node-name": "node0" } } # # <- { "return": {} } # ## -{ 'command': 'x-blockdev-insert-medium', +{ 'command': 'blockdev-insert-medium', 'data': { 'id': 'str', 'node-name': 'str'} } =20 @@ -3509,8 +3503,8 @@ # # Changes the medium inserted into a block device by ejecting the current = medium # and loading a new image file which is inserted as the new medium (this c= ommand -# combines blockdev-open-tray, x-blockdev-remove-medium, -# x-blockdev-insert-medium and blockdev-close-tray). +# combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-med= ium +# and blockdev-close-tray). # # @device: Block device name (deprecated, use @id instead) # diff --git a/blockdev.c b/blockdev.c index 2f9aef4167..8e977eef11 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2508,7 +2508,7 @@ out: aio_context_release(aio_context); } =20 -void qmp_x_blockdev_remove_medium(const char *id, Error **errp) +void qmp_blockdev_remove_medium(const char *id, Error **errp) { blockdev_remove_medium(false, NULL, true, id, errp); } @@ -2586,8 +2586,8 @@ static void blockdev_insert_medium(bool has_device, c= onst char *device, qmp_blockdev_insert_anon_medium(blk, bs, errp); } =20 -void qmp_x_blockdev_insert_medium(const char *id, const char *node_name, - Error **errp) +void qmp_blockdev_insert_medium(const char *id, const char *node_name, + Error **errp) { blockdev_insert_medium(false, NULL, true, id, node_name, errp); } diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 3635ea6d41..3934e62ef7 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1596,7 +1596,7 @@ static void test_atapi_tray(void) rsp =3D qmp_receive(); QDECREF(rsp); =20 - qmp_discard_response("{'execute': 'x-blockdev-remove-medium', " + qmp_discard_response("{'execute': 'blockdev-remove-medium', " "'arguments': {'id': 'cd0'}}"); =20 /* Test the tray without a medium */ @@ -1612,7 +1612,7 @@ static void test_atapi_tray(void) "'driver': 'raw', " "'file': { 'driver': 'file', " "'filename': %s }}}", is= o); - qmp_discard_response("{'execute': 'x-blockdev-insert-medium'," + qmp_discard_response("{'execute': 'blockdev-insert-medium'," "'arguments': { 'id': 'cd0', " "'node-name': 'node0' }}"); =20 diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index 5c36a5fb4d..c3404a3171 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -348,9 +348,9 @@ class ThrottleTestRemovableMedia(iotests.QMPTestCase): # Now eject cd0 and insert cd1 result =3D self.vm.qmp("blockdev-open-tray", id=3D'dev0') self.assert_qmp(result, 'return', {}) - result =3D self.vm.qmp("x-blockdev-remove-medium", id=3D'dev0') + result =3D self.vm.qmp("blockdev-remove-medium", id=3D'dev0') self.assert_qmp(result, 'return', {}) - result =3D self.vm.qmp("x-blockdev-insert-medium", id=3D'dev0', no= de_name=3D'cd1') + result =3D self.vm.qmp("blockdev-insert-medium", id=3D'dev0', node= _name=3D'cd1') self.assert_qmp(result, 'return', {}) =20 # Check that the I/O limits are still the same @@ -359,7 +359,7 @@ class ThrottleTestRemovableMedia(iotests.QMPTestCase): self.assert_qmp(result, 'return[0]/inserted/bps', 50) =20 # Eject cd1 - result =3D self.vm.qmp("x-blockdev-remove-medium", id=3D'dev0') + result =3D self.vm.qmp("blockdev-remove-medium", id=3D'dev0') self.assert_qmp(result, 'return', {}) =20 # Check that we can't set limits if the device has no medium diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118 index ca6965d23c..a0469b570e 100755 --- a/tests/qemu-iotests/118 +++ b/tests/qemu-iotests/118 @@ -233,7 +233,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): else: self.assert_qmp(result, 'return[0]/inserted/image/filename', o= ld_img) =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_name) self.assert_qmp(result, 'return', {}) =20 @@ -242,7 +242,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): self.assert_qmp(result, 'return[0]/tray_open', True) self.assert_qmp_absent(result, 'return[0]/inserted') =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_name, node_name=3D'new') self.assert_qmp(result, 'return', {}) =20 @@ -271,7 +271,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): if not self.has_real_tray: return =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_= name) self.assert_qmp(result, 'error/class', 'GenericError') =20 def test_insert_on_closed(self): @@ -285,7 +285,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): 'driver': 'file'}) self.assert_qmp(result, 'return', {}) =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_= name, node_name=3D'new') self.assert_qmp(result, 'error/class', 'GenericError') =20 @@ -320,7 +320,7 @@ class TestInitiallyFilled(GeneralChangeTestsBaseClass): =20 self.wait_for_open() =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_= name, node_name=3D'new') self.assert_qmp(result, 'error/class', 'GenericError') =20 @@ -345,7 +345,7 @@ class TestInitiallyEmpty(GeneralChangeTestsBaseClass): =20 self.wait_for_open() =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_= name) # Should be a no-op self.assert_qmp(result, 'return', {}) =20 @@ -603,13 +603,13 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/ro', False) self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 - result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_= name) self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') self.assert_qmp_absent(result, 'return[0]/inserted') =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_= name, node_name=3D'new') self.assert_qmp(result, 'return', {}) =20 @@ -642,7 +642,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass): =20 # For device-less BBs, calling blockdev-open-tray or blockdev-clos= e-tray # is not necessary - result =3D self.vm.qmp('x-blockdev-remove-medium', id=3Dself.devic= e_name) + result =3D self.vm.qmp('blockdev-remove-medium', id=3Dself.device_= name) self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') @@ -655,7 +655,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass): 'driver': 'file'}) self.assert_qmp(result, 'return', {}) =20 - result =3D self.vm.qmp('x-blockdev-insert-medium', id=3Dself.devic= e_name, + result =3D self.vm.qmp('blockdev-insert-medium', id=3Dself.device_= name, node_name=3D'node0') self.assert_qmp(result, 'return', {}) =20 diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index f8f02808a9..cc7fe337f3 100644 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -133,7 +133,7 @@ class TestBlockdevDel(iotests.QMPTestCase): # Insert a BlockDriverState def insertDrive(self, device, node): self.checkBlockDriverState(node) - result =3D self.vm.qmp('x-blockdev-insert-medium', + result =3D self.vm.qmp('blockdev-insert-medium', id =3D device, node_name =3D node) self.assert_qmp(result, 'return', {}) self.checkBlockDriverState(node) --=20 2.13.6 From nobody Mon May 6 02:47:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716868866328.5244589521292; Tue, 23 Jan 2018 06:14:28 -0800 (PST) Received: from localhost ([::1]:59790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzLF-0004iY-U9 for importer@patchew.org; Tue, 23 Jan 2018 09:14:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9r-0003a6-OR for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9l-0005tI-SL for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42608) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9Z-0005kP-NP; Tue, 23 Jan 2018 09:02:21 -0500 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 D07A12CE965; Tue, 23 Jan 2018 14:02:20 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCE8C7CD9D; Tue, 23 Jan 2018 14:02:19 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:42 +0100 Message-Id: <20180123140201.31163-11-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.29]); Tue, 23 Jan 2018 14:02:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/29] qemu-iotests: Fix locking issue in 102 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz 102 truncates a qcow2 file (the raw file) on purpose while a VM is running. However, image locking will usually prevent exactly this. The fact that most people have not noticed until now (I suppose you may have seen sporadic failures, but not taken them too seriously, like me) further shows that this truncation is actually not really done concurrently, but that the VM is still starting up by this point and has not yet opened the image. Remedy this by waiting for the monitor shell to appear before the qemu-img invocation so we know the VM is up. Signed-off-by: Max Reitz Message-id: 20171129185102.29390-1-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/102 | 7 ++++++- tests/qemu-iotests/102.out | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/102 b/tests/qemu-iotests/102 index d7ad8d9840..04b3f28445 100755 --- a/tests/qemu-iotests/102 +++ b/tests/qemu-iotests/102 @@ -69,7 +69,12 @@ $QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io =20 qemu_comm_method=3Dmonitor _launch_qemu -drive if=3Dnone,file=3D"$TEST_IMG= ",id=3Ddrv0 =20 -$QEMU_IMG resize -f raw --shrink "$TEST_IMG" $((5 * 64 * 1024)) +# Wait for a prompt to appear (so we know qemu has opened the image) +_send_qemu_cmd '' '(qemu)' + +$QEMU_IMG resize --shrink --image-opts \ + "driver=3Draw,file.driver=3Dfile,file.filename=3D$TEST_IMG,file.lockin= g=3Doff" \ + $((5 * 64 * 1024)) =20 _send_qemu_cmd $QEMU_HANDLE 'qemu-io drv0 map' 'allocated' \ | sed -e 's/^(qemu).*qemu-io drv0 map...$/(qemu) qemu-io drv0 map/' diff --git a/tests/qemu-iotests/102.out b/tests/qemu-iotests/102.out index ccf172abd9..4401b08fee 100644 --- a/tests/qemu-iotests/102.out +++ b/tests/qemu-iotests/102.out @@ -14,8 +14,9 @@ Offset Length Mapped to File Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D65536 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Image resized. QEMU X.Y.Z monitor - type 'help' for more information +Image resized. +(qemu) (qemu) qemu-io drv0 map 64 KiB (0x10000) bytes allocated at offset 0 bytes (0x0) *** done --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717237565936.1400528998693; Tue, 23 Jan 2018 06:20:37 -0800 (PST) Received: from localhost ([::1]:60134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzRE-0001wT-Si for importer@patchew.org; Tue, 23 Jan 2018 09:20:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9r-0003ZW-A4 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9q-0005vw-4y for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9b-0005lX-0u; Tue, 23 Jan 2018 09:02:23 -0500 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 2311B356EB; Tue, 23 Jan 2018 14:02:22 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E6148517; Tue, 23 Jan 2018 14:02:21 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:43 +0100 Message-Id: <20180123140201.31163-12-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.30]); Tue, 23 Jan 2018 14:02:22 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/29] block/vmdk: Fix , instead of ; at end of line X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Signed-off-by: Max Reitz Message-id: 20171123020832.8165-2-mreitz@redhat.com Reviewed-by: Eric Blake Reviewed-by: Fam Zheng Signed-off-by: Max Reitz --- block/vmdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vmdk.c b/block/vmdk.c index c665bcc977..1ae47b1c2e 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1398,7 +1398,7 @@ static int vmdk_write_extent(VmdkExtent *extent, int6= 4_t cluster_offset, qemu_iovec_concat(&local_qiov, qiov, qiov_offset, n_bytes); } =20 - write_offset =3D cluster_offset + offset_in_cluster, + write_offset =3D cluster_offset + offset_in_cluster; ret =3D bdrv_co_pwritev(extent->file, write_offset, n_bytes, &local_qiov, 0); =20 --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716550516658.8510288984686; Tue, 23 Jan 2018 06:09:10 -0800 (PST) Received: from localhost ([::1]:59742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzG9-0008UN-9N for importer@patchew.org; Tue, 23 Jan 2018 09:09:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9u-0003cf-HC for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9k-0005sj-SW for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46154) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9c-0005mY-9l; Tue, 23 Jan 2018 09:02:24 -0500 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 691427484D; Tue, 23 Jan 2018 14:02:23 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72F24BA9D; Tue, 23 Jan 2018 14:02:22 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:44 +0100 Message-Id: <20180123140201.31163-13-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.26]); Tue, 23 Jan 2018 14:02:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/29] qcow2: No persistent dirty bitmaps for compat=0.10 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Persistent dirty bitmaps require a properly functioning autoclear_features field, or we cannot track when an unsupporting program might overwrite them. Therefore, we cannot support them for compat=3D0.10 images. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-3-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- block/qcow2-bitmap.c | 10 ++++++++++ block/qcow2.c | 14 +++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index f45e46cfbd..efa10c6663 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -1449,6 +1449,16 @@ bool qcow2_can_store_new_dirty_bitmap(BlockDriverSta= te *bs, bool found; Qcow2BitmapList *bm_list; =20 + if (s->qcow_version < 3) { + /* Without autoclear_features, we would always have to assume + * that a program without persistent dirty bitmap support has + * accessed this qcow2 file when opening it, and would thus + * have to drop all dirty bitmaps (defeating their purpose). + */ + error_setg(errp, "Cannot store dirty bitmaps in qcow2 v2 files"); + goto fail; + } + if (check_constraints_on_bitmap(bs, name, granularity, errp) !=3D 0) { goto fail; } diff --git a/block/qcow2.c b/block/qcow2.c index 4348b2c0c5..1f80961e1b 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -302,9 +302,17 @@ static int qcow2_read_extensions(BlockDriverState *bs,= uint64_t start_offset, } =20 if (!(s->autoclear_features & QCOW2_AUTOCLEAR_BITMAPS)) { - warn_report("a program lacking bitmap support " - "modified this file, so all bitmaps are now " - "considered inconsistent"); + if (s->qcow_version < 3) { + /* Let's be a bit more specific */ + warn_report("This qcow2 v2 image contains bitmaps, but= " + "they may have been modified by a program " + "without persistent bitmap support; so now= " + "they must all be considered inconsistent"= ); + } else { + warn_report("a program lacking bitmap support " + "modified this file, so all bitmaps are no= w " + "considered inconsistent"); + } error_printf("Some clusters may be leaked, " "run 'qemu-img check -r' on the image " "file to fix."); --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717069438223.38573048635556; Tue, 23 Jan 2018 06:17:49 -0800 (PST) Received: from localhost ([::1]:59873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzOV-0007fg-U5 for importer@patchew.org; Tue, 23 Jan 2018 09:17:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9t-0003by-0Z for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9o-0005uO-4Y for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59275) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9d-0005nN-Jm; Tue, 23 Jan 2018 09:02:25 -0500 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 AF5724AD78; Tue, 23 Jan 2018 14:02:24 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9BB218977; Tue, 23 Jan 2018 14:02:23 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:45 +0100 Message-Id: <20180123140201.31163-14-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.30]); Tue, 23 Jan 2018 14:02:24 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/29] block/qcow: Add blkdebug events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz This is not necessarily complete, but it should include the most important places. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-4-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- block/qcow.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/block/qcow.c b/block/qcow.c index 9569deeaf0..d552a6eba8 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -379,6 +379,7 @@ static int get_cluster_offset(BlockDriverState *bs, /* update the L1 entry */ s->l1_table[l1_index] =3D l2_offset; tmp =3D cpu_to_be64(l2_offset); + BLKDBG_EVENT(bs->file, BLKDBG_L1_UPDATE); ret =3D bdrv_pwrite_sync(bs->file, s->l1_table_offset + l1_index * sizeof(tmp), &tmp, sizeof(tmp)); @@ -409,6 +410,7 @@ static int get_cluster_offset(BlockDriverState *bs, } } l2_table =3D s->l2_cache + (min_index << s->l2_bits); + BLKDBG_EVENT(bs->file, BLKDBG_L2_LOAD); if (new_l2_table) { memset(l2_table, 0, s->l2_size * sizeof(uint64_t)); ret =3D bdrv_pwrite_sync(bs->file, l2_offset, l2_table, @@ -432,6 +434,7 @@ static int get_cluster_offset(BlockDriverState *bs, ((cluster_offset & QCOW_OFLAG_COMPRESSED) && allocate =3D=3D 1)) { if (!allocate) return 0; + BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_ALLOC); /* allocate a new cluster */ if ((cluster_offset & QCOW_OFLAG_COMPRESSED) && (n_end - n_start) < s->cluster_sectors) { @@ -447,6 +450,7 @@ static int get_cluster_offset(BlockDriverState *bs, } cluster_offset =3D QEMU_ALIGN_UP(cluster_offset, s->cluster_si= ze); /* write the cluster content */ + BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); ret =3D bdrv_pwrite(bs->file, cluster_offset, s->cluster_cache, s->cluster_size); if (ret < 0) { @@ -486,6 +490,7 @@ static int get_cluster_offset(BlockDriverState *bs, NULL) < 0) { return -EIO; } + BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); ret =3D bdrv_pwrite(bs->file, cluster_offset + i * 512, s->cluster_data, 512); @@ -503,6 +508,11 @@ static int get_cluster_offset(BlockDriverState *bs, /* update L2 table */ tmp =3D cpu_to_be64(cluster_offset); l2_table[l2_index] =3D tmp; + if (allocate =3D=3D 2) { + BLKDBG_EVENT(bs->file, BLKDBG_L2_UPDATE_COMPRESSED); + } else { + BLKDBG_EVENT(bs->file, BLKDBG_L2_UPDATE); + } ret =3D bdrv_pwrite_sync(bs->file, l2_offset + l2_index * sizeof(t= mp), &tmp, sizeof(tmp)); if (ret < 0) { @@ -579,6 +589,7 @@ static int decompress_cluster(BlockDriverState *bs, uin= t64_t cluster_offset) if (s->cluster_cache_offset !=3D coffset) { csize =3D cluster_offset >> (63 - s->cluster_bits); csize &=3D (s->cluster_size - 1); + BLKDBG_EVENT(bs->file, BLKDBG_READ_COMPRESSED); ret =3D bdrv_pread(bs->file, coffset, s->cluster_data, csize); if (ret !=3D csize) return -1; @@ -635,6 +646,8 @@ static coroutine_fn int qcow_co_readv(BlockDriverState = *bs, int64_t sector_num, hd_iov.iov_len =3D n * 512; qemu_iovec_init_external(&hd_qiov, &hd_iov, 1); qemu_co_mutex_unlock(&s->lock); + /* qcow2 emits this on bs->file instead of bs->backing */ + BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO); ret =3D bdrv_co_readv(bs->backing, sector_num, n, &hd_qiov= ); qemu_co_mutex_lock(&s->lock); if (ret < 0) { @@ -661,6 +674,7 @@ static coroutine_fn int qcow_co_readv(BlockDriverState = *bs, int64_t sector_num, hd_iov.iov_len =3D n * 512; qemu_iovec_init_external(&hd_qiov, &hd_iov, 1); qemu_co_mutex_unlock(&s->lock); + BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); ret =3D bdrv_co_readv(bs->file, (cluster_offset >> 9) + index_in_cluster, n, &hd_qiov); @@ -754,6 +768,7 @@ static coroutine_fn int qcow_co_writev(BlockDriverState= *bs, int64_t sector_num, hd_iov.iov_len =3D n * 512; qemu_iovec_init_external(&hd_qiov, &hd_iov, 1); qemu_co_mutex_unlock(&s->lock); + BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); ret =3D bdrv_co_writev(bs->file, (cluster_offset >> 9) + index_in_cluster, n, &hd_qiov); @@ -1048,6 +1063,7 @@ qcow_co_pwritev_compressed(BlockDriverState *bs, uint= 64_t offset, .iov_len =3D out_len, }; qemu_iovec_init_external(&hd_qiov, &iov, 1); + BLKDBG_EVENT(bs->file, BLKDBG_WRITE_COMPRESSED); ret =3D bdrv_co_pwritev(bs->file, cluster_offset, out_len, &hd_qiov, 0= ); if (ret < 0) { goto fail; --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717358643301.78146047608413; Tue, 23 Jan 2018 06:22:38 -0800 (PST) Received: from localhost ([::1]:60196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzT3-0003Ji-7O for importer@patchew.org; Tue, 23 Jan 2018 09:22:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9v-0003ch-He for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9q-0005wM-My for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39480) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9f-0005oS-HQ; Tue, 23 Jan 2018 09:02:27 -0500 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 967BF19D065; Tue, 23 Jan 2018 14:02:26 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B6CEBA75; Tue, 23 Jan 2018 14:02:24 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:46 +0100 Message-Id: <20180123140201.31163-15-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.29]); Tue, 23 Jan 2018 14:02:26 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/29] block/vmdk: Add blkdebug events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz This is certainly not complete, but it includes at least write_aio and read_aio. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-5-mreitz@redhat.com Reviewed-by: Fam Zheng Signed-off-by: Max Reitz --- block/vmdk.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index 1ae47b1c2e..d71cec4f31 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1075,6 +1075,8 @@ static int get_whole_cluster(BlockDriverState *bs, /* Read backing data before skip range */ if (skip_start_bytes > 0) { if (bs->backing) { + /* qcow2 emits this on bs->file instead of bs->backing */ + BLKDBG_EVENT(extent->file, BLKDBG_COW_READ); ret =3D bdrv_pread(bs->backing, offset, whole_grain, skip_start_bytes); if (ret < 0) { @@ -1082,6 +1084,7 @@ static int get_whole_cluster(BlockDriverState *bs, goto exit; } } + BLKDBG_EVENT(extent->file, BLKDBG_COW_WRITE); ret =3D bdrv_pwrite(extent->file, cluster_offset, whole_grain, skip_start_bytes); if (ret < 0) { @@ -1092,6 +1095,8 @@ static int get_whole_cluster(BlockDriverState *bs, /* Read backing data after skip range */ if (skip_end_bytes < cluster_bytes) { if (bs->backing) { + /* qcow2 emits this on bs->file instead of bs->backing */ + BLKDBG_EVENT(extent->file, BLKDBG_COW_READ); ret =3D bdrv_pread(bs->backing, offset + skip_end_bytes, whole_grain + skip_end_bytes, cluster_bytes - skip_end_bytes); @@ -1100,6 +1105,7 @@ static int get_whole_cluster(BlockDriverState *bs, goto exit; } } + BLKDBG_EVENT(extent->file, BLKDBG_COW_WRITE); ret =3D bdrv_pwrite(extent->file, cluster_offset + skip_end_bytes, whole_grain + skip_end_bytes, cluster_bytes - skip_end_bytes); @@ -1120,6 +1126,7 @@ static int vmdk_L2update(VmdkExtent *extent, VmdkMeta= Data *m_data, { offset =3D cpu_to_le32(offset); /* update L2 table */ + BLKDBG_EVENT(extent->file, BLKDBG_L2_UPDATE); if (bdrv_pwrite_sync(extent->file, ((int64_t)m_data->l2_offset * 512) + (m_data->l2_index * sizeof(offset)), @@ -1218,6 +1225,7 @@ static int get_cluster_offset(BlockDriverState *bs, } } l2_table =3D extent->l2_cache + (min_index * extent->l2_size); + BLKDBG_EVENT(extent->file, BLKDBG_L2_LOAD); if (bdrv_pread(extent->file, (int64_t)l2_offset * 512, l2_table, @@ -1393,9 +1401,13 @@ static int vmdk_write_extent(VmdkExtent *extent, int= 64_t cluster_offset, .iov_len =3D n_bytes, }; qemu_iovec_init_external(&local_qiov, &iov, 1); + + BLKDBG_EVENT(extent->file, BLKDBG_WRITE_COMPRESSED); } else { qemu_iovec_init(&local_qiov, qiov->niov); qemu_iovec_concat(&local_qiov, qiov, qiov_offset, n_bytes); + + BLKDBG_EVENT(extent->file, BLKDBG_WRITE_AIO); } =20 write_offset =3D cluster_offset + offset_in_cluster; @@ -1437,6 +1449,7 @@ static int vmdk_read_extent(VmdkExtent *extent, int64= _t cluster_offset, =20 =20 if (!extent->compressed) { + BLKDBG_EVENT(extent->file, BLKDBG_READ_AIO); ret =3D bdrv_co_preadv(extent->file, cluster_offset + offset_in_cluster, bytes, qiov, 0); @@ -1450,6 +1463,7 @@ static int vmdk_read_extent(VmdkExtent *extent, int64= _t cluster_offset, buf_bytes =3D cluster_bytes * 2; cluster_buf =3D g_malloc(buf_bytes); uncomp_buf =3D g_malloc(cluster_bytes); + BLKDBG_EVENT(extent->file, BLKDBG_READ_COMPRESSED); ret =3D bdrv_pread(extent->file, cluster_offset, cluster_buf, buf_bytes); @@ -1527,6 +1541,8 @@ vmdk_co_preadv(BlockDriverState *bs, uint64_t offset,= uint64_t bytes, qemu_iovec_reset(&local_qiov); qemu_iovec_concat(&local_qiov, qiov, bytes_done, n_bytes); =20 + /* qcow2 emits this on bs->file instead of bs->backing */ + BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO); ret =3D bdrv_co_preadv(bs->backing, offset, n_bytes, &local_qiov, 0); if (ret < 0) { --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717040423747.8726383350448; Tue, 23 Jan 2018 06:17:20 -0800 (PST) Received: from localhost ([::1]:59870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzO0-0007FN-4s for importer@patchew.org; Tue, 23 Jan 2018 09:17:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9t-0003cY-IV for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9o-0005uI-3I for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50628) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9g-0005pb-U2; Tue, 23 Jan 2018 09:02:29 -0500 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 11E4CC0568F9; Tue, 23 Jan 2018 14:02:28 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id E87EE18B32; Tue, 23 Jan 2018 14:02:26 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:47 +0100 Message-Id: <20180123140201.31163-16-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.32]); Tue, 23 Jan 2018 14:02:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/29] iotests: Fix _img_info for backslashes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz read without -r eats backslashes. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-6-mreitz@redhat.com Reviewed-by: Fam Zheng Signed-off-by: Max Reitz --- tests/qemu-iotests/common.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index dbae7d74ba..6fa0495e10 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -338,7 +338,7 @@ _img_info() -e "s#$IMGFMT#IMGFMT#g" \ -e "/^disk size:/ D" \ -e "/actual-size/ D" | \ - while IFS=3D'' read line; do + while IFS=3D'' read -r line; do if [[ $format_specific =3D=3D 1 ]]; then discard=3D0 elif [[ $line =3D=3D "Format specific information:" ]]; then --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716697310857.7725138392778; Tue, 23 Jan 2018 06:11:37 -0800 (PST) Received: from localhost ([::1]:59773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzIW-0002Cw-I3 for importer@patchew.org; Tue, 23 Jan 2018 09:11:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9r-0003Zb-Ci for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9q-0005w8-Br for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39556) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9i-0005r2-Qx; Tue, 23 Jan 2018 09:02:31 -0500 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 E6D3C37EE7; Tue, 23 Jan 2018 14:02:29 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 636E2BA9D; Tue, 23 Jan 2018 14:02:28 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:48 +0100 Message-Id: <20180123140201.31163-17-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.29]); Tue, 23 Jan 2018 14:02:29 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 16/29] iotests: Drop format-specific in _filter_img_info X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz _filter_img_info should remove format-specific information, too. We already have such a filter in _img_info, and it is very useful for query-block-named-block-nodes (etc.), too. However, in 198 we need that information (but we still want the rest of the filter), so make that filtering optional. Note that "the rest of the filter" includes filtering of the test directory, so we can drop the _filter_testdir from 198 at the same time. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-7-mreitz@redhat.com Reviewed-by: Eric Blake Reviewed-by: Fam Zheng Signed-off-by: Max Reitz --- tests/qemu-iotests/198 | 6 ++++-- tests/qemu-iotests/common.filter | 29 ++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/198 b/tests/qemu-iotests/198 index 34ef666381..a84a058396 100755 --- a/tests/qemu-iotests/198 +++ b/tests/qemu-iotests/198 @@ -91,11 +91,13 @@ $QEMU_IO --object $SECRET0 --object $SECRET1 -c "read -= P 0x9 0 $size" --image-op =20 echo echo "=3D=3D checking image base =3D=3D" -$QEMU_IMG info --image-opts $IMGSPECBASE | _filter_img_info | _filter_test= dir | sed -e "/^disk size:/ D" +$QEMU_IMG info --image-opts $IMGSPECBASE | _filter_img_info --format-speci= fic \ + | sed -e "/^disk size:/ D" =20 echo echo "=3D=3D checking image layer =3D=3D" -$QEMU_IMG info --image-opts $IMGSPECLAYER | _filter_img_info | _filter_tes= tdir | sed -e "/^disk size:/ D" +$QEMU_IMG info --image-opts $IMGSPECLAYER | _filter_img_info --format-spec= ific \ + | sed -e "/^disk size:/ D" =20 =20 # success, all done diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index f08248bfd9..cb2be23340 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -140,6 +140,15 @@ _filter_img_create() =20 _filter_img_info() { + if [[ "$1" =3D=3D "--format-specific" ]]; then + local format_specific=3D1 + shift + else + local format_specific=3D0 + fi + + discard=3D0 + regex_json_spec_start=3D'^ *"format-specific": \{' sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$IMGFMT#IMGFMT#g" \ @@ -160,7 +169,25 @@ _filter_img_info() -e "/block_state_zero: \\(on\\|off\\)/d" \ -e "/log_size: [0-9]\\+/d" \ -e "s/iters: [0-9]\\+/iters: 1024/" \ - -e "s/uuid: [-a-f0-9]\\+/uuid: 00000000-0000-0000-0000-00000000000= 0/" + -e "s/uuid: [-a-f0-9]\\+/uuid: 00000000-0000-0000-0000-00000000000= 0/" | \ + while IFS=3D'' read -r line; do + if [[ $format_specific =3D=3D 1 ]]; then + discard=3D0 + elif [[ $line =3D=3D "Format specific information:" ]]; then + discard=3D1 + elif [[ $line =3D~ $regex_json_spec_start ]]; then + discard=3D2 + regex_json_spec_end=3D"^${line%%[^ ]*}\\},? *$" + fi + if [[ $discard =3D=3D 0 ]]; then + echo "$line" + elif [[ $discard =3D=3D 1 && ! $line ]]; then + echo + discard=3D0 + elif [[ $discard =3D=3D 2 && $line =3D~ $regex_json_spec_end ]]; t= hen + discard=3D0 + fi + done } =20 # filter out offsets and file names from qemu-img map; good for both --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716703368915.1737942762537; Tue, 23 Jan 2018 06:11:43 -0800 (PST) Received: from localhost ([::1]:59774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzIc-0002If-Gu for importer@patchew.org; Tue, 23 Jan 2018 09:11:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzA2-0003l0-LT for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9y-00060T-Oa for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46300) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9k-0005s0-2m; Tue, 23 Jan 2018 09:02:32 -0500 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 393E182101; Tue, 23 Jan 2018 14:02:31 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40B85BA9D; Tue, 23 Jan 2018 14:02:30 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:49 +0100 Message-Id: <20180123140201.31163-18-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.26]); Tue, 23 Jan 2018 14:02:31 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 17/29] iotests: Forbid 020 for non-file protocols X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz This test does funny things like TEST_IMG=3D"TEST_IMG.base" _make_test_img that usually only work with the file protocol. More specifically, they do not work with the most interesting non-file protocols, so we might as well skip this for anything but file. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-8-mreitz@redhat.com Reviewed-by: Fam Zheng Signed-off-by: Max Reitz --- tests/qemu-iotests/020 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020 index cefe3a830e..d22ab81414 100755 --- a/tests/qemu-iotests/020 +++ b/tests/qemu-iotests/020 @@ -42,18 +42,12 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 # Any format supporting backing files _supported_fmt qcow qcow2 vmdk qed -_supported_proto generic -_unsupported_proto vxhs +_supported_proto file _supported_os Linux _unsupported_imgopts "subformat=3DmonolithicFlat" \ "subformat=3DtwoGbMaxExtentFlat" \ "subformat=3DtwoGbMaxExtentSparse" =20 -# NFS does not support bdrv_reopen_prepare thus qemu-img commit fails. -if [ "$IMGPROTO" =3D "nfs" ]; then - _notrun "image protocol $IMGPROTO does not support bdrv_commit" -fi - TEST_OFFSETS=3D"0 4294967296" =20 TEST_IMG_SAVE=3D"$TEST_IMG" --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717643859296.8628920827517; Tue, 23 Jan 2018 06:27:23 -0800 (PST) Received: from localhost ([::1]:60604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzXn-0006zu-8c for importer@patchew.org; Tue, 23 Jan 2018 09:27:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzA7-0003qY-Ap for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9z-00061W-NQ for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50678) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9l-0005t6-Q4; Tue, 23 Jan 2018 09:02:33 -0500 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 E2428C057F92; Tue, 23 Jan 2018 14:02:32 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AF478517; Tue, 23 Jan 2018 14:02:31 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:50 +0100 Message-Id: <20180123140201.31163-19-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.32]); Tue, 23 Jan 2018 14:02:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 18/29] iotests: Skip 103 for refcount_bits=1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Signed-off-by: Max Reitz Message-id: 20171123020832.8165-9-mreitz@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/103 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/103 b/tests/qemu-iotests/103 index ecbd8ebd71..d0cfab8844 100755 --- a/tests/qemu-iotests/103 +++ b/tests/qemu-iotests/103 @@ -40,6 +40,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file nfs _supported_os Linux +# Internal snapshots are (currently) impossible with refcount_bits=3D1 +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' =20 IMG_SIZE=3D64K =20 --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717334060393.42928935386897; Tue, 23 Jan 2018 06:22:14 -0800 (PST) Received: from localhost ([::1]:60188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzSm-00035H-BU for importer@patchew.org; Tue, 23 Jan 2018 09:22:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edz9z-0003h3-CA for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9y-00060D-Ct for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46324) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9n-0005td-3t; Tue, 23 Jan 2018 09:02:35 -0500 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 3883F82102; Tue, 23 Jan 2018 14:02:34 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3ED908517; Tue, 23 Jan 2018 14:02:33 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:51 +0100 Message-Id: <20180123140201.31163-20-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.26]); Tue, 23 Jan 2018 14:02:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 19/29] iotests: Fix 020 for vmdk X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz vmdk cannot work with anything but vmdk backing files, so make the backing file be the same format as the overlay. Reported-by: John Snow Signed-off-by: Max Reitz Message-id: 20171123020832.8165-11-mreitz@redhat.com Reviewed-by: John Snow Reviewed-by: Fam Zheng Signed-off-by: Max Reitz --- tests/qemu-iotests/020 | 9 ++++++--- tests/qemu-iotests/020.out | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020 index d22ab81414..eac5080f83 100755 --- a/tests/qemu-iotests/020 +++ b/tests/qemu-iotests/020 @@ -111,10 +111,12 @@ echo echo 'Testing failing commit' echo =20 +TEST_IMG=3D"$TEST_IMG.base" _make_test_img 1M + # Create an image with a null backing file to which committing will fail (= with # ENOSPC so we can distinguish the result from some generic EIO which may = be # generated anywhere in the block layer) -_make_test_img -b "json:{'driver': 'raw', +_make_test_img -b "json:{'driver': '$IMGFMT', 'file': { 'driver': 'blkdebug', 'inject-error': [{ @@ -123,14 +125,15 @@ _make_test_img -b "json:{'driver': 'raw', 'once': true }], 'image': { - 'driver': 'null-co' + 'driver': 'file', + 'filename': '$TEST_IMG.base' }}}" =20 # Just write anything so committing will not be a no-op $QEMU_IO -c 'writev 0 64k' "$TEST_IMG" | _filter_qemu_io =20 $QEMU_IMG commit "$TEST_IMG" -_cleanup_test_img +_cleanup =20 # success, all done echo "*** done" diff --git a/tests/qemu-iotests/020.out b/tests/qemu-iotests/020.out index 165b70aa49..4b722b2dd0 100644 --- a/tests/qemu-iotests/020.out +++ b/tests/qemu-iotests/020.out @@ -1078,7 +1078,8 @@ No errors were found on the image. =20 Testing failing commit =20 -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 backing_fil= e=3Djson:{'driver': 'raw',, +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D1048576 +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 backing_file= =3Djson:{'driver': 'IMGFMT',, 'file': { 'driver': 'blkdebug',, 'inject-error': [{ @@ -1087,7 +1088,8 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 backing_file=3Djson:{'d 'once': true }],, 'image': { - 'driver': 'null-co' + 'driver': 'file',, + 'filename': 'TEST_DIR/t.IMGFMT.base' }}} wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717465551773.6115489828912; Tue, 23 Jan 2018 06:24:25 -0800 (PST) Received: from localhost ([::1]:60253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzUu-0004ht-TQ for importer@patchew.org; Tue, 23 Jan 2018 09:24:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzA4-0003mU-9H for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzA3-000682-9S for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40570) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9p-0005uk-8e; Tue, 23 Jan 2018 09:02:37 -0500 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 570008B100; Tue, 23 Jan 2018 14:02:36 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AB0F8517; Tue, 23 Jan 2018 14:02:34 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:52 +0100 Message-Id: <20180123140201.31163-21-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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]); Tue, 23 Jan 2018 14:02:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 20/29] iotests: Fix 051 for compat=0.10 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz 051 has both compat=3D1.1 and compat=3D0.10 tests (once it uses lazy_refcounts, once it tests that setting them does not work). For the compat=3D0.10 tests, it already explicitly creates a suitable image. So let's just ignore the user-specified compat level for the lazy_refcounts test and explicitly create a compat=3D1.1 image there, too. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-12-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/051 | 2 ++ tests/qemu-iotests/051.out | 1 + tests/qemu-iotests/051.pc.out | 1 + 3 files changed, 4 insertions(+) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index dba8816c9f..0c3be16489 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -131,6 +131,8 @@ echo echo =3D=3D=3D Enable and disable lazy refcounting on the command line, pl= us some invalid values =3D=3D=3D echo =20 +_make_test_img -o compat=3D1.1 "$size" + run_qemu -drive file=3D"$TEST_IMG",format=3Dqcow2,lazy-refcounts=3Don run_qemu -drive file=3D"$TEST_IMG",format=3Dqcow2,lazy-refcounts=3Doff run_qemu -drive file=3D"$TEST_IMG",format=3Dqcow2,lazy-refcounts=3D diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out index e3c6eaba57..dd9846d1ce 100644 --- a/tests/qemu-iotests/051.out +++ b/tests/qemu-iotests/051.out @@ -77,6 +77,7 @@ QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,file.backing.dr= iver=3Dqcow2,file.backing.f =20 =3D=3D=3D Enable and disable lazy refcounting on the command line, plus so= me invalid values =3D=3D=3D =20 +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2,lazy-refcounts=3Don QEMU X.Y.Z monitor - type 'help' for more information (qemu) quit diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index f2c5622cee..830c11880a 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -77,6 +77,7 @@ QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,file.backing.dr= iver=3Dqcow2,file.backing.f =20 =3D=3D=3D Enable and disable lazy refcounting on the command line, plus so= me invalid values =3D=3D=3D =20 +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2,lazy-refcounts=3Don QEMU X.Y.Z monitor - type 'help' for more information (qemu) quit --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717548919541.6440618272079; Tue, 23 Jan 2018 06:25:48 -0800 (PST) Received: from localhost ([::1]:60396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzWE-0005n6-9H for importer@patchew.org; Tue, 23 Jan 2018 09:25:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzA4-0003mS-1J for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edz9z-000618-DU for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41638) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9q-0005vu-NU; Tue, 23 Jan 2018 09:02:38 -0500 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 D22BB2D1CD; Tue, 23 Jan 2018 14:02:37 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7E4F8517; Tue, 23 Jan 2018 14:02:36 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:53 +0100 Message-Id: <20180123140201.31163-22-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.38]); Tue, 23 Jan 2018 14:02:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 21/29] iotests: Fix 059's reference output X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz As of commit 9877860e7bd1e26ee70ab9bb5ebc34c92bf23bf5, vmdk fails differently when opening the sample image. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-13-mreitz@redhat.com Reviewed-by: John Snow Reviewed-by: Fam Zheng Signed-off-by: Max Reitz --- tests/qemu-iotests/059.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index f6dce7947c..1ac5d56233 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -2358,5 +2358,5 @@ Offset Length Mapped to File 0x140000000 0x10000 0x50000 TEST_DIR/t-s003.vmdk =20 =3D=3D=3D Testing afl image with a very large capacity =3D=3D=3D -qemu-img: Can't get image size 'TEST_DIR/afl9.IMGFMT': File too large +qemu-img: Could not open 'TEST_DIR/afl9.IMGFMT': Could not open 'TEST_DIR/= afl9.IMGFMT': Invalid argument *** done --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716875920819.4714472931572; Tue, 23 Jan 2018 06:14:35 -0800 (PST) Received: from localhost ([::1]:59791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzLP-0004sv-0I for importer@patchew.org; Tue, 23 Jan 2018 09:14:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzAC-0003x2-66 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzA6-0006FL-5l for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53626) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9s-0005xL-VM; Tue, 23 Jan 2018 09:02:41 -0500 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 1839981DF3; Tue, 23 Jan 2018 14:02:40 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30A788517; Tue, 23 Jan 2018 14:02:38 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:54 +0100 Message-Id: <20180123140201.31163-23-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.25]); Tue, 23 Jan 2018 14:02:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 22/29] iotests: Fix 067 for compat=0.10 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz 067 works very well with compat=3D0.10 once you remove format-specific information from the QMP output. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-14-mreitz@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/067 | 3 +- tests/qemu-iotests/067.out | 97 +++++++++++++-----------------------------= ---- 2 files changed, 28 insertions(+), 72 deletions(-) diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067 index 9d561ef786..fe259f6165 100755 --- a/tests/qemu-iotests/067 +++ b/tests/qemu-iotests/067 @@ -57,7 +57,8 @@ function run_qemu() { do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | _filter_qemu \ | _filter_actual_image_size \ - | _filter_generated_node_ids | _filter_qmp_events + | _filter_generated_node_ids | _filter_qmp_event= s \ + | _filter_img_info } =20 size=3D128M diff --git a/tests/qemu-iotests/067.out b/tests/qemu-iotests/067.out index 58e83c4505..2e71cff3ce 100644 --- a/tests/qemu-iotests/067.out +++ b/tests/qemu-iotests/067.out @@ -3,7 +3,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1342177= 28 =20 =3D=3D=3D -drive/-device and device_del =3D=3D=3D =20 -Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2,if=3Dnone,id=3Ddisk= -device virtio-blk,drive=3Ddisk,id=3Dvirtio0 +Testing: -drive file=3DTEST_DIR/t.IMGFMT,format=3DIMGFMT,if=3Dnone,id=3Ddi= sk -device virtio-blk,drive=3Ddisk,id=3Dvirtio0 { QMP_VERSION } @@ -23,26 +23,17 @@ Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2,= if=3Dnone,id=3Ddisk -device virti "detect_zeroes": "off", "image": { "virtual-size": 134217728, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "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": "NODE_NAME", "backing_file_depth": 0, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, @@ -54,7 +45,7 @@ Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2,if= =3Dnone,id=3Ddisk -device virti "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false }, "qdev": "/machine/peripheral/virtio0/virtio-backend", @@ -81,7 +72,7 @@ Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2,if= =3Dnone,id=3Ddisk -device virti =20 =3D=3D=3D -drive/device_add and device_del =3D=3D=3D =20 -Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2,if=3Dnone,id=3Ddisk +Testing: -drive file=3DTEST_DIR/t.IMGFMT,format=3DIMGFMT,if=3Dnone,id=3Ddi= sk { QMP_VERSION } @@ -100,26 +91,17 @@ Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2= ,if=3Dnone,id=3Ddisk "detect_zeroes": "off", "image": { "virtual-size": 134217728, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "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": "NODE_NAME", "backing_file_depth": 0, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, @@ -131,7 +113,7 @@ Testing: -drive file=3DTEST_DIR/t.qcow2,format=3Dqcow2,= if=3Dnone,id=3Ddisk "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false }, "type": "unknown" @@ -183,26 +165,17 @@ Testing: "detect_zeroes": "off", "image": { "virtual-size": 134217728, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "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": "NODE_NAME", "backing_file_depth": 0, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, @@ -214,7 +187,7 @@ Testing: "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false }, "type": "unknown" @@ -263,26 +236,17 @@ Testing: "detect_zeroes": "off", "image": { "virtual-size": 134217728, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "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": "disk", "backing_file_depth": 0, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, @@ -294,7 +258,7 @@ Testing: "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false }, { @@ -302,7 +266,7 @@ Testing: "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -323,7 +287,7 @@ Testing: "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false } ] @@ -347,26 +311,17 @@ Testing: "detect_zeroes": "off", "image": { "virtual-size": 134217728, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "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": "disk", "backing_file_depth": 0, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, @@ -378,7 +333,7 @@ Testing: "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false }, { @@ -386,7 +341,7 @@ Testing: "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -407,7 +362,7 @@ Testing: "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false } ] --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717824213504.30417207240737; Tue, 23 Jan 2018 06:30:24 -0800 (PST) Received: from localhost ([::1]:60735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzae-0000U6-Hw for importer@patchew.org; Tue, 23 Jan 2018 09:30:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzAF-00041W-Oh for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzA6-0006FD-4n for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41678) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9u-0005xv-76; Tue, 23 Jan 2018 09:02:42 -0500 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 5545D4A6EA; Tue, 23 Jan 2018 14:02:41 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64B7018977; Tue, 23 Jan 2018 14:02:40 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:55 +0100 Message-Id: <20180123140201.31163-24-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.38]); Tue, 23 Jan 2018 14:02:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 23/29] iotests: Make 089 compatible with compat=0.10 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz The only thing that is missing is a _filter_img_info after the "$QEMU_IO -c info" invocations. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-15-mreitz@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/089 | 4 ++-- tests/qemu-iotests/089.out | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/qemu-iotests/089 b/tests/qemu-iotests/089 index 9bfe2307b3..0b059aba90 100755 --- a/tests/qemu-iotests/089 +++ b/tests/qemu-iotests/089 @@ -119,11 +119,11 @@ echo =20 # Both options given directly and those given in the filename should be us= ed $QEMU_IO -c "open -o driver=3Dqcow2 json:{\"file.filename\":\"$TEST_IMG\"}= " \ - -c "info" 2>&1 | _filter_testdir | _filter_imgfmt + -c "info" 2>&1 | _filter_img_info =20 # Options given directly should be prioritized over those given in the fil= ename $QEMU_IO -c "open -o driver=3Dqcow2 json:{\"driver\":\"raw\",\"file.filena= me\":\"$TEST_IMG\"}" \ - -c "info" 2>&1 | _filter_testdir | _filter_imgfmt + -c "info" 2>&1 | _filter_img_info =20 =20 # success, all done diff --git a/tests/qemu-iotests/089.out b/tests/qemu-iotests/089.out index 18f5fdda7a..0bf5a13ec1 100644 --- a/tests/qemu-iotests/089.out +++ b/tests/qemu-iotests/089.out @@ -38,17 +38,7 @@ cluster_size: 65536 format name: IMGFMT cluster size: 64 KiB vm state offset: 512 MiB -Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 - corrupt: false format name: IMGFMT cluster size: 64 KiB vm state offset: 512 MiB -Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 - corrupt: false *** done --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15167174457513.1002137787445463; Tue, 23 Jan 2018 06:24:05 -0800 (PST) Received: from localhost ([::1]:60241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzUV-0004NY-Vh for importer@patchew.org; Tue, 23 Jan 2018 09:24:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzA7-0003qZ-BS for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzA2-00066J-Cb for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:02:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61487) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9v-0005yt-L5; Tue, 23 Jan 2018 09:02:43 -0500 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 C205CC0567A3; Tue, 23 Jan 2018 14:02:42 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id A717A8517; Tue, 23 Jan 2018 14:02:41 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:56 +0100 Message-Id: <20180123140201.31163-25-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.32]); Tue, 23 Jan 2018 14:02:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 24/29] iotests: Make 184 image-less X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz 184 does not need an image, so don't use one. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-16-mreitz@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/184 | 25 ++++-------------- tests/qemu-iotests/184.out | 63 +++++++-----------------------------------= ---- 2 files changed, 14 insertions(+), 74 deletions(-) diff --git a/tests/qemu-iotests/184 b/tests/qemu-iotests/184 index ee96c99af3..2b68284d58 100755 --- a/tests/qemu-iotests/184 +++ b/tests/qemu-iotests/184 @@ -27,18 +27,12 @@ echo "QA output created by $seq" here=3D`pwd` status=3D1 # failure is the default! =20 -_cleanup() -{ - _cleanup_test_img -} -trap "_cleanup; exit \$status" 0 1 2 3 15 +trap "exit \$status" 0 1 2 3 15 =20 # get standard environment, filters and checks . ./common.rc . ./common.filter =20 -_supported_fmt qcow2 -_supported_proto file _supported_os Linux =20 function do_run_qemu() @@ -55,7 +49,6 @@ function run_qemu() | _filter_actual_image_size } =20 -_make_test_img 64M test_throttle=3D$($QEMU_IMG --help|grep throttle) [ "$test_throttle" =3D "" ] && _supported_fmt throttle =20 @@ -66,12 +59,8 @@ run_qemu < Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716740566264.5208641301432; Tue, 23 Jan 2018 06:12:20 -0800 (PST) Received: from localhost ([::1]:59778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzJD-0002nx-K1 for importer@patchew.org; Tue, 23 Jan 2018 09:12:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzAG-00042U-KL for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzAA-0006N2-L6 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39896) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9x-0005zg-Aj; Tue, 23 Jan 2018 09:02:45 -0500 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 68F663DE3F; Tue, 23 Jan 2018 14:02:44 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F839BA79; Tue, 23 Jan 2018 14:02:42 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:57 +0100 Message-Id: <20180123140201.31163-26-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.29]); Tue, 23 Jan 2018 14:02:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 25/29] iotests: Make 191 work with qcow2 options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz In order for 191 to work with an explicit refcount_bits or compat=3D0.10, we should strip format-specific information from the output--and we can do so by using _filter_img_info. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-17-mreitz@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/191 | 5 +- tests/qemu-iotests/191.out | 313 +++++++++++++----------------------------= ---- 2 files changed, 91 insertions(+), 227 deletions(-) diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191 index ad785e10b1..dfad6555e4 100755 --- a/tests/qemu-iotests/191 +++ b/tests/qemu-iotests/191 @@ -45,7 +45,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.qemu =20 _supported_fmt qcow2 -_unsupported_imgopts compat=3D0.10 _supported_proto file _supported_os Linux =20 @@ -92,7 +91,7 @@ echo =3D=3D=3D Check that both top and top2 point to base= now =3D=3D=3D echo =20 _send_qemu_cmd $h "{ 'execute': 'query-named-block-nodes' }" "^}" | - _filter_generated_node_ids | _filter_actual_image_size + _filter_generated_node_ids | _filter_actual_image_size | _filter_img_i= nfo =20 _send_qemu_cmd $h "{ 'execute': 'quit' }" "^}" wait=3D1 _cleanup_qemu @@ -140,7 +139,7 @@ echo =3D=3D=3D Check that both top and top2 point to ba= se now =3D=3D=3D echo =20 _send_qemu_cmd $h "{ 'execute': 'query-named-block-nodes' }" "^}" | - _filter_generated_node_ids | _filter_actual_image_size + _filter_generated_node_ids | _filter_actual_image_size | _filter_img_i= nfo =20 _send_qemu_cmd $h "{ 'execute': 'quit' }" "^}" wait=3D1 _cleanup_qemu diff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out index 73c0ed454c..190c5f049a 100644 --- a/tests/qemu-iotests/191.out +++ b/tests/qemu-iotests/191.out @@ -44,49 +44,31 @@ wrote 65536/65536 bytes at offset 1048576 "image": { "backing-image": { "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "dirty-flag": false }, - "backing-filename-format": "qcow2", + "backing-filename-format": "IMGFMT", "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.ovl2", + "filename": "TEST_DIR/t.IMGFMT.ovl2", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "TEST_DIR/t.qcow2.base", - "backing-filename": "TEST_DIR/t.qcow2.base", + "full-backing-filename": "TEST_DIR/t.IMGFMT.base", + "backing-filename": "TEST_DIR/t.IMGFMT.base", "dirty-flag": false }, "iops_wr": 0, "ro": false, "node-name": "top2", "backing_file_depth": 1, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, - "backing_file": "TEST_DIR/t.qcow2.base", + "backing_file": "TEST_DIR/t.IMGFMT.base", "encrypted": false, "bps": 0, "bps_rd": 0, @@ -95,7 +77,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.ovl2", + "file": "TEST_DIR/t.IMGFMT.ovl2", "encryption_key_missing": false }, { @@ -103,7 +85,7 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "TEST_DIR/t.qcow2.ovl2", + "filename": "TEST_DIR/t.IMGFMT.ovl2", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -124,7 +106,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.ovl2", + "file": "TEST_DIR/t.IMGFMT.ovl2", "encryption_key_missing": false }, { @@ -133,49 +115,31 @@ wrote 65536/65536 bytes at offset 1048576 "image": { "backing-image": { "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "dirty-flag": false }, - "backing-filename-format": "qcow2", + "backing-filename-format": "IMGFMT", "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "TEST_DIR/t.qcow2.base", - "backing-filename": "TEST_DIR/t.qcow2.base", + "full-backing-filename": "TEST_DIR/t.IMGFMT.base", + "backing-filename": "TEST_DIR/t.IMGFMT.base", "dirty-flag": false }, "iops_wr": 0, "ro": false, "node-name": "top", "backing_file_depth": 1, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, - "backing_file": "TEST_DIR/t.qcow2.base", + "backing_file": "TEST_DIR/t.IMGFMT.base", "encrypted": false, "bps": 0, "bps_rd": 0, @@ -184,7 +148,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false }, { @@ -192,7 +156,7 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -213,7 +177,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false }, { @@ -222,49 +186,31 @@ wrote 65536/65536 bytes at offset 1048576 "image": { "backing-image": { "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "dirty-flag": false }, - "backing-filename-format": "qcow2", + "backing-filename-format": "IMGFMT", "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.mid", + "filename": "TEST_DIR/t.IMGFMT.mid", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "TEST_DIR/t.qcow2.base", - "backing-filename": "TEST_DIR/t.qcow2.base", + "full-backing-filename": "TEST_DIR/t.IMGFMT.base", + "backing-filename": "TEST_DIR/t.IMGFMT.base", "dirty-flag": false }, "iops_wr": 0, "ro": false, "node-name": "mid", "backing_file_depth": 1, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, - "backing_file": "TEST_DIR/t.qcow2.base", + "backing_file": "TEST_DIR/t.IMGFMT.base", "encrypted": false, "bps": 0, "bps_rd": 0, @@ -273,7 +219,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.mid", + "file": "TEST_DIR/t.IMGFMT.mid", "encryption_key_missing": false }, { @@ -281,7 +227,7 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 393216, - "filename": "TEST_DIR/t.qcow2.mid", + "filename": "TEST_DIR/t.IMGFMT.mid", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -302,7 +248,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.mid", + "file": "TEST_DIR/t.IMGFMT.mid", "encryption_key_missing": false }, { @@ -310,26 +256,17 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "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": "base", "backing_file_depth": 0, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, @@ -341,7 +278,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.base", + "file": "TEST_DIR/t.IMGFMT.base", "encryption_key_missing": false }, { @@ -349,7 +286,7 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 393216, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -370,7 +307,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.base", + "file": "TEST_DIR/t.IMGFMT.base", "encryption_key_missing": false } ] @@ -447,49 +384,31 @@ wrote 65536/65536 bytes at offset 1048576 "image": { "backing-image": { "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "dirty-flag": false }, - "backing-filename-format": "qcow2", + "backing-filename-format": "IMGFMT", "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.ovl2", + "filename": "TEST_DIR/t.IMGFMT.ovl2", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "TEST_DIR/t.qcow2.base", - "backing-filename": "TEST_DIR/t.qcow2.base", + "full-backing-filename": "TEST_DIR/t.IMGFMT.base", + "backing-filename": "TEST_DIR/t.IMGFMT.base", "dirty-flag": false }, "iops_wr": 0, "ro": true, "node-name": "NODE_NAME", "backing_file_depth": 1, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, - "backing_file": "TEST_DIR/t.qcow2.base", + "backing_file": "TEST_DIR/t.IMGFMT.base", "encrypted": false, "bps": 0, "bps_rd": 0, @@ -498,7 +417,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.ovl2", + "file": "TEST_DIR/t.IMGFMT.ovl2", "encryption_key_missing": false }, { @@ -506,7 +425,7 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "TEST_DIR/t.qcow2.ovl2", + "filename": "TEST_DIR/t.IMGFMT.ovl2", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -527,7 +446,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.ovl2", + "file": "TEST_DIR/t.IMGFMT.ovl2", "encryption_key_missing": false }, { @@ -537,68 +456,41 @@ wrote 65536/65536 bytes at offset 1048576 "backing-image": { "backing-image": { "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "dirty-flag": false }, - "backing-filename-format": "qcow2", + "backing-filename-format": "IMGFMT", "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.ovl2", + "filename": "TEST_DIR/t.IMGFMT.ovl2", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "TEST_DIR/t.qcow2.base", - "backing-filename": "TEST_DIR/t.qcow2.base", + "full-backing-filename": "TEST_DIR/t.IMGFMT.base", + "backing-filename": "TEST_DIR/t.IMGFMT.base", "dirty-flag": false }, - "backing-filename-format": "qcow2", + "backing-filename-format": "IMGFMT", "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.ovl3", + "filename": "TEST_DIR/t.IMGFMT.ovl3", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "TEST_DIR/t.qcow2.ovl2", - "backing-filename": "TEST_DIR/t.qcow2.ovl2", + "full-backing-filename": "TEST_DIR/t.IMGFMT.ovl2", + "backing-filename": "TEST_DIR/t.IMGFMT.ovl2", "dirty-flag": false }, "iops_wr": 0, "ro": false, "node-name": "top2", "backing_file_depth": 2, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, - "backing_file": "TEST_DIR/t.qcow2.ovl2", + "backing_file": "TEST_DIR/t.IMGFMT.ovl2", "encrypted": false, "bps": 0, "bps_rd": 0, @@ -607,7 +499,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.ovl3", + "file": "TEST_DIR/t.IMGFMT.ovl3", "encryption_key_missing": false }, { @@ -615,7 +507,7 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "TEST_DIR/t.qcow2.ovl3", + "filename": "TEST_DIR/t.IMGFMT.ovl3", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -636,7 +528,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.ovl3", + "file": "TEST_DIR/t.IMGFMT.ovl3", "encryption_key_missing": false }, { @@ -644,26 +536,17 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "dirty-flag": false }, "iops_wr": 0, "ro": true, "node-name": "NODE_NAME", "backing_file_depth": 0, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, @@ -675,7 +558,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.base", + "file": "TEST_DIR/t.IMGFMT.base", "encryption_key_missing": false }, { @@ -683,7 +566,7 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 393216, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -704,7 +587,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2.base", + "file": "TEST_DIR/t.IMGFMT.base", "encryption_key_missing": false }, { @@ -713,49 +596,31 @@ wrote 65536/65536 bytes at offset 1048576 "image": { "backing-image": { "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2.base", + "filename": "TEST_DIR/t.IMGFMT.base", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "dirty-flag": false }, - "backing-filename-format": "qcow2", + "backing-filename-format": "IMGFMT", "virtual-size": 67108864, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "cluster-size": 65536, - "format": "qcow2", + "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "TEST_DIR/t.qcow2.base", - "backing-filename": "TEST_DIR/t.qcow2.base", + "full-backing-filename": "TEST_DIR/t.IMGFMT.base", + "backing-filename": "TEST_DIR/t.IMGFMT.base", "dirty-flag": false }, "iops_wr": 0, "ro": false, "node-name": "top", "backing_file_depth": 1, - "drv": "qcow2", + "drv": "IMGFMT", "iops": 0, "bps_wr": 0, "write_threshold": 0, - "backing_file": "TEST_DIR/t.qcow2.base", + "backing_file": "TEST_DIR/t.IMGFMT.base", "encrypted": false, "bps": 0, "bps_rd": 0, @@ -764,7 +629,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false }, { @@ -772,7 +637,7 @@ wrote 65536/65536 bytes at offset 1048576 "detect_zeroes": "off", "image": { "virtual-size": 197120, - "filename": "TEST_DIR/t.qcow2", + "filename": "TEST_DIR/t.IMGFMT", "format": "file", "actual-size": SIZE, "dirty-flag": false @@ -793,7 +658,7 @@ wrote 65536/65536 bytes at offset 1048576 "direct": false, "writeback": true }, - "file": "TEST_DIR/t.qcow2", + "file": "TEST_DIR/t.IMGFMT", "encryption_key_missing": false } ] --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717728448416.81977435247313; Tue, 23 Jan 2018 06:28:48 -0800 (PST) Received: from localhost ([::1]:60659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzZ4-0007nt-QU for importer@patchew.org; Tue, 23 Jan 2018 09:28:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzAD-0003z2-Ls for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzA9-0006L5-Lc for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50876) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edz9y-000607-Nf; Tue, 23 Jan 2018 09:02:46 -0500 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 D31E4C0567A3; Tue, 23 Jan 2018 14:02:45 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id B76718517; Tue, 23 Jan 2018 14:02:44 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:58 +0100 Message-Id: <20180123140201.31163-27-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.32]); Tue, 23 Jan 2018 14:02:45 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 26/29] iotests: Filter compat-dependent info in 198 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz There is a bit of image-specific information which depends on the qcow2 compat level. Filter it so that 198 works with compat=3D0.10 (and any refcount_bits value). Note that we cannot simply drop the --format-specific switch because we do need the "encrypt" information. Signed-off-by: Max Reitz Message-id: 20171123020832.8165-18-mreitz@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/198 | 6 ++++-- tests/qemu-iotests/198.out | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/198 b/tests/qemu-iotests/198 index a84a058396..54eaaf5153 100755 --- a/tests/qemu-iotests/198 +++ b/tests/qemu-iotests/198 @@ -92,12 +92,14 @@ $QEMU_IO --object $SECRET0 --object $SECRET1 -c "read -= P 0x9 0 $size" --image-op echo echo "=3D=3D checking image base =3D=3D" $QEMU_IMG info --image-opts $IMGSPECBASE | _filter_img_info --format-speci= fic \ - | sed -e "/^disk size:/ D" + | sed -e "/^disk size:/ D" -e '/refcount bits:/ D' -e '/compat:/ D' \ + -e '/lazy refcounts:/ D' -e '/corrupt:/ D' =20 echo echo "=3D=3D checking image layer =3D=3D" $QEMU_IMG info --image-opts $IMGSPECLAYER | _filter_img_info --format-spec= ific \ - | sed -e "/^disk size:/ D" + | sed -e "/^disk size:/ D" -e '/refcount bits:/ D' -e '/compat:/ D' \ + -e '/lazy refcounts:/ D' -e '/corrupt:/ D' =20 =20 # success, all done diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out index 2db565e16b..adb805cce9 100644 --- a/tests/qemu-iotests/198.out +++ b/tests/qemu-iotests/198.out @@ -36,9 +36,6 @@ image: json:{"encrypt.key-secret": "sec0", "driver": "IMG= FMT", "file": {"driver" file format: IMGFMT virtual size: 16M (16777216 bytes) Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 encrypt: ivgen alg: plain64 hash alg: sha256 @@ -75,7 +72,6 @@ Format specific information: key offset: 1810432 payload offset: 2068480 master key iters: 1024 - corrupt: false =20 =3D=3D checking image layer =3D=3D image: json:{"encrypt.key-secret": "sec1", "driver": "IMGFMT", "file": {"d= river": "file", "filename": "TEST_DIR/t.IMGFMT"}} @@ -83,9 +79,6 @@ file format: IMGFMT virtual size: 16M (16777216 bytes) backing file: TEST_DIR/t.IMGFMT.base Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 encrypt: ivgen alg: plain64 hash alg: sha256 @@ -122,5 +115,4 @@ Format specific information: key offset: 1810432 payload offset: 2068480 master key iters: 1024 - corrupt: false *** done --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717897426823.8135891602234; Tue, 23 Jan 2018 06:31:37 -0800 (PST) Received: from localhost ([::1]:60788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzbr-0001HP-Ri for importer@patchew.org; Tue, 23 Jan 2018 09:31:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzAE-00040S-MI for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzA9-0006KU-7Q for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40800) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edzA0-00062Z-UL; Tue, 23 Jan 2018 09:02:49 -0500 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 0754B8B10E; Tue, 23 Jan 2018 14:02:48 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 313608517; Tue, 23 Jan 2018 14:02:46 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:01:59 +0100 Message-Id: <20180123140201.31163-28-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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]); Tue, 23 Jan 2018 14:02:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 27/29] iotests: Make 059 pass on machines with little RAM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Signed-off-by: Max Reitz Message-id: 20171129192411.6637-1-mreitz@redhat.com Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/059 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index a1c34eeb7c..40f89eae18 100755 --- a/tests/qemu-iotests/059 +++ b/tests/qemu-iotests/059 @@ -152,7 +152,9 @@ done echo echo "=3D=3D=3D Testing afl image with a very large capacity =3D=3D=3D" _use_sample_img afl9.vmdk.bz2 -_img_info +# The sed makes this test pass on machines with little RAM +# (and also with 32 bit builds) +_img_info | sed -e 's/Cannot allocate memory/Invalid argument/' _cleanup_test_img =20 # success, all done --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516717086670287.01949702717434; Tue, 23 Jan 2018 06:18:06 -0800 (PST) Received: from localhost ([::1]:59874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzOn-0007u2-Rh for importer@patchew.org; Tue, 23 Jan 2018 09:18:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzAP-0004AN-Qd for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzAK-0006Vd-1S for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46594) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edzA2-00065a-Ib; Tue, 23 Jan 2018 09:02:50 -0500 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 A6B4182101; Tue, 23 Jan 2018 14:02:49 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 584A07F5D7; Tue, 23 Jan 2018 14:02:48 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:02:00 +0100 Message-Id: <20180123140201.31163-29-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.26]); Tue, 23 Jan 2018 14:02:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 28/29] iotests: Split 177 into two parts for compat=0.10 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake When originally written, test 177 explicitly took care to run with compat=3D0.10. Then I botched my own test in commit 81c219ac and f0a9c18f, by adding additional actions that require v3 images. Split out the new code into a new v3-only test, 204, and revert 177 back to its original state other than a new comment. Reported-by: Max Reitz Signed-off-by: Eric Blake Message-id: 20180117165420.15946-2-eblake@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/177 | 20 +++----- tests/qemu-iotests/177.out | 22 ++------- tests/qemu-iotests/204 | 119 +++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/204.out | 63 ++++++++++++++++++++++++ tests/qemu-iotests/group | 1 + 5 files changed, 193 insertions(+), 32 deletions(-) create mode 100755 tests/qemu-iotests/204 create mode 100644 tests/qemu-iotests/204.out diff --git a/tests/qemu-iotests/177 b/tests/qemu-iotests/177 index 28990977f1..396986da89 100755 --- a/tests/qemu-iotests/177 +++ b/tests/qemu-iotests/177 @@ -2,7 +2,7 @@ # # Test corner cases with unusual block geometries # -# Copyright (C) 2016-2017 Red Hat, Inc. +# Copyright (C) 2016-2018 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,13 +37,15 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter =20 +# This test is runnable under compat=3D0.10; see test 204 for additional +# tests specific to compat=3D1.1. + _supported_fmt qcow2 _supported_proto file =20 CLUSTER_SIZE=3D1M size=3D128M options=3Ddriver=3Dblkdebug,image.driver=3Dqcow2 -nested_opts=3Dimage.file.driver=3Dfile,image.file.filename=3D$TEST_IMG =20 echo echo "=3D=3D setting up files =3D=3D" @@ -51,7 +53,7 @@ echo "=3D=3D setting up files =3D=3D" TEST_IMG=3D"$TEST_IMG.base" _make_test_img $size $QEMU_IO -c "write -P 11 0 $size" "$TEST_IMG.base" | _filter_qemu_io _make_test_img -b "$TEST_IMG.base" -$QEMU_IO -c "write -P 22 0 110M" "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "write -P 22 0 $size" "$TEST_IMG" | _filter_qemu_io =20 # Limited to 64k max-transfer echo @@ -82,13 +84,6 @@ $QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IM= G" \ -c "discard 80000001 30M" | _filter_qemu_io =20 echo -echo "=3D=3D block status smaller than alignment =3D=3D" -limits=3Dalign=3D4k -$QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \ - -c "alloc 1 1" -c "alloc 0x6dffff0 1000" -c "alloc 127m 5P" \ - -c map | _filter_qemu_io - -echo echo "=3D=3D verify image content =3D=3D" =20 function verify_io() @@ -110,13 +105,10 @@ function verify_io() echo read -P 0 32M 32M echo read -P 22 64M 13M echo read -P $discarded 77M 29M - echo read -P 22 106M 4M - echo read -P 11 110M 18M + echo read -P 22 106M 22M } =20 verify_io | $QEMU_IO -r "$TEST_IMG" | _filter_qemu_io -$QEMU_IMG map --image-opts "$options,$nested_opts,align=3D4k" \ - | _filter_qemu_img_map =20 _check_test_img =20 diff --git a/tests/qemu-iotests/177.out b/tests/qemu-iotests/177.out index f788b55e20..e887542678 100644 --- a/tests/qemu-iotests/177.out +++ b/tests/qemu-iotests/177.out @@ -5,8 +5,8 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D13= 4217728 wrote 134217728/134217728 bytes at offset 0 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 backing_file= =3DTEST_DIR/t.IMGFMT.base -wrote 115343360/115343360 bytes at offset 0 -110 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 134217728/134217728 bytes at offset 0 +128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D constrained alignment and max-transfer =3D=3D wrote 131072/131072 bytes at offset 1000 @@ -26,13 +26,6 @@ wrote 33554432/33554432 bytes at offset 33554432 discard 31457280/31457280 bytes at offset 80000001 30 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 -=3D=3D block status smaller than alignment =3D=3D -1/1 bytes allocated at offset 1 bytes -16/1000 bytes allocated at offset 110 MiB -0/1048576 bytes allocated at offset 127 MiB -110 MiB (0x6e00000) bytes allocated at offset 0 bytes (0x0) -18 MiB (0x1200000) bytes not allocated at offset 110 MiB (0x6e00000) - =3D=3D verify image content =3D=3D read 1000/1000 bytes at offset 0 1000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -50,14 +43,7 @@ read 13631488/13631488 bytes at offset 67108864 13 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 30408704/30408704 bytes at offset 80740352 29 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -read 4194304/4194304 bytes at offset 111149056 -4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -read 18874368/18874368 bytes at offset 115343360 -18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Offset Length File -0 0x800000 TEST_DIR/t.IMGFMT -0x900000 0x2400000 TEST_DIR/t.IMGFMT -0x3c00000 0x1100000 TEST_DIR/t.IMGFMT -0x6a00000 0x400000 TEST_DIR/t.IMGFMT +read 23068672/23068672 bytes at offset 111149056 +22 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) No errors were found on the image. *** done diff --git a/tests/qemu-iotests/204 b/tests/qemu-iotests/204 new file mode 100755 index 0000000000..feb69d2ada --- /dev/null +++ b/tests/qemu-iotests/204 @@ -0,0 +1,119 @@ +#!/bin/bash +# +# Test corner cases with unusual block geometries +# +# Copyright (C) 2016-2018 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# creator +owner=3Deblake@redhat.com + +seq=3D`basename $0` +echo "QA output created by $seq" + +here=3D`pwd` +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_supported_fmt qcow2 +_supported_proto file +# This test assumes that discard leaves zero clusters; see test 177 for +# other tests that also work in older images +_unsupported_imgopts 'compat=3D0.10' + +CLUSTER_SIZE=3D1M +size=3D128M +options=3Ddriver=3Dblkdebug,image.driver=3Dqcow2 +nested_opts=3Dimage.file.driver=3Dfile,image.file.filename=3D$TEST_IMG + +echo +echo "=3D=3D setting up files =3D=3D" + +TEST_IMG=3D"$TEST_IMG.base" _make_test_img $size +$QEMU_IO -c "write -P 11 0 $size" "$TEST_IMG.base" | _filter_qemu_io +_make_test_img -b "$TEST_IMG.base" +$QEMU_IO -c "write -P 22 0 110M" "$TEST_IMG" | _filter_qemu_io + +# Limited to 64k max-transfer +echo +echo "=3D=3D constrained alignment and max-transfer =3D=3D" +limits=3Dalign=3D4k,max-transfer=3D64k +$QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \ + -c "write -P 33 1000 128k" -c "read -P 33 1000 128k" | _filter_qe= mu_io + +echo +echo "=3D=3D write zero with constrained max-transfer =3D=3D" +limits=3Dalign=3D512,max-transfer=3D64k,opt-write-zero=3D$CLUSTER_SIZE +$QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \ + -c "write -z 8003584 2093056" | _filter_qemu_io + +# non-power-of-2 write-zero/discard alignments +echo +echo "=3D=3D non-power-of-2 write zeroes limits =3D=3D" + +limits=3Dalign=3D512,opt-write-zero=3D15M,max-write-zero=3D15M,opt-discard= =3D15M,max-discard=3D15M +$QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \ + -c "write -z 32M 32M" | _filter_qemu_io + +echo +echo "=3D=3D non-power-of-2 discard limits =3D=3D" + +limits=3Dalign=3D512,opt-write-zero=3D15M,max-write-zero=3D15M,opt-discard= =3D15M,max-discard=3D15M +$QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \ + -c "discard 80000001 30M" | _filter_qemu_io + +echo +echo "=3D=3D block status smaller than alignment =3D=3D" +limits=3Dalign=3D4k +$QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \ + -c "alloc 1 1" -c "alloc 0x6dffff0 1000" -c "alloc 127m 5P" \ + -c map | _filter_qemu_io + +echo +echo "=3D=3D verify image content =3D=3D" + +function verify_io() +{ + echo read -P 22 0 1000 + echo read -P 33 1000 128k + echo read -P 22 132072 7871512 + echo read -P 0 8003584 2093056 + echo read -P 22 10096640 23457792 + echo read -P 0 32M 32M + echo read -P 22 64M 13M + echo read -P 0 77M 29M + echo read -P 22 106M 4M + echo read -P 11 110M 18M +} + +verify_io | $QEMU_IO -r "$TEST_IMG" | _filter_qemu_io +$QEMU_IMG map --image-opts "$options,$nested_opts,align=3D4k" \ + | _filter_qemu_img_map + +_check_test_img + +# success, all done +echo "*** done" +status=3D0 diff --git a/tests/qemu-iotests/204.out b/tests/qemu-iotests/204.out new file mode 100644 index 0000000000..f3a10fbe90 --- /dev/null +++ b/tests/qemu-iotests/204.out @@ -0,0 +1,63 @@ +QA output created by 204 + +=3D=3D setting up files =3D=3D +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D134217728 +wrote 134217728/134217728 bytes at offset 0 +128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 backing_file= =3DTEST_DIR/t.IMGFMT.base +wrote 115343360/115343360 bytes at offset 0 +110 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D constrained alignment and max-transfer =3D=3D +wrote 131072/131072 bytes at offset 1000 +128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 131072/131072 bytes at offset 1000 +128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D write zero with constrained max-transfer =3D=3D +wrote 2093056/2093056 bytes at offset 8003584 +1.996 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D non-power-of-2 write zeroes limits =3D=3D +wrote 33554432/33554432 bytes at offset 33554432 +32 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D non-power-of-2 discard limits =3D=3D +discard 31457280/31457280 bytes at offset 80000001 +30 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D block status smaller than alignment =3D=3D +1/1 bytes allocated at offset 1 bytes +16/1000 bytes allocated at offset 110 MiB +0/1048576 bytes allocated at offset 127 MiB +110 MiB (0x6e00000) bytes allocated at offset 0 bytes (0x0) +18 MiB (0x1200000) bytes not allocated at offset 110 MiB (0x6e00000) + +=3D=3D verify image content =3D=3D +read 1000/1000 bytes at offset 0 +1000 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 131072/131072 bytes at offset 1000 +128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 7871512/7871512 bytes at offset 132072 +7.507 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 2093056/2093056 bytes at offset 8003584 +1.996 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 23457792/23457792 bytes at offset 10096640 +22.371 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 33554432/33554432 bytes at offset 33554432 +32 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 13631488/13631488 bytes at offset 67108864 +13 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 30408704/30408704 bytes at offset 80740352 +29 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 4194304/4194304 bytes at offset 111149056 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 18874368/18874368 bytes at offset 115343360 +18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Offset Length File +0 0x800000 TEST_DIR/t.IMGFMT +0x900000 0x2400000 TEST_DIR/t.IMGFMT +0x3c00000 0x1100000 TEST_DIR/t.IMGFMT +0x6a00000 0x400000 TEST_DIR/t.IMGFMT +No errors were found on the image. +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index c4703cd782..8fc4f62cca 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -200,3 +200,4 @@ 201 rw auto migration 202 rw auto quick 203 rw auto +204 rw auto quick --=20 2.13.6 From nobody Mon May 6 02:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516716910947554.6622329908157; Tue, 23 Jan 2018 06:15:10 -0800 (PST) Received: from localhost ([::1]:59795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzLx-0005Qp-Tx for importer@patchew.org; Tue, 23 Jan 2018 09:15:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edzAM-00049B-PV for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edzAD-0006PD-60 for qemu-devel@nongnu.org; Tue, 23 Jan 2018 09:03:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41786) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edzA3-00068B-SB; Tue, 23 Jan 2018 09:02:51 -0500 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 0FFA6CD003; Tue, 23 Jan 2018 14:02:51 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-26.ams2.redhat.com [10.36.117.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 013F5BAAF; Tue, 23 Jan 2018 14:02:49 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 23 Jan 2018 15:02:01 +0100 Message-Id: <20180123140201.31163-30-kwolf@redhat.com> In-Reply-To: <20180123140201.31163-1-kwolf@redhat.com> References: <20180123140201.31163-1-kwolf@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.38]); Tue, 23 Jan 2018 14:02:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 29/29] iotests: Disable some tests for compat=0.10 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Tests 080, 130, 137, and 176 simply do not work with compat=3D0.10 for the reasons stated there. Signed-off-by: Max Reitz Message-Id: <20171123020832.8165-10-mreitz@redhat.com> [eblake: fix 177 in a separate commit] Signed-off-by: Eric Blake Message-id: 20180117165420.15946-3-eblake@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/080 | 5 +++-- tests/qemu-iotests/130 | 2 ++ tests/qemu-iotests/137 | 2 ++ tests/qemu-iotests/176 | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080 index 55044c700b..1c2bd85742 100755 --- a/tests/qemu-iotests/080 +++ b/tests/qemu-iotests/080 @@ -41,8 +41,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -# Internal snapshots are (currently) impossible with refcount_bits=3D1 -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' +# - Internal snapshots are (currently) impossible with refcount_bits=3D1 +# - This is generally a test for compat=3D1.1 images +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' 'compat=3D0.10' =20 header_size=3D104 =20 diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130 index e7e43de6d6..2c4b94da1b 100755 --- a/tests/qemu-iotests/130 +++ b/tests/qemu-iotests/130 @@ -45,6 +45,8 @@ _supported_fmt qcow2 _supported_proto generic _unsupported_proto vxhs _supported_os Linux +# We are going to use lazy-refcounts +_unsupported_imgopts 'compat=3D0.10' =20 qemu_comm_method=3D"monitor" =20 diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137 index eb91e517d7..5a01250005 100755 --- a/tests/qemu-iotests/137 +++ b/tests/qemu-iotests/137 @@ -41,6 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# We are going to use lazy-refcounts +_unsupported_imgopts 'compat=3D0.10' =20 =20 _make_test_img 64M diff --git a/tests/qemu-iotests/176 b/tests/qemu-iotests/176 index b8dc17c592..d38b3aeb91 100755 --- a/tests/qemu-iotests/176 +++ b/tests/qemu-iotests/176 @@ -48,6 +48,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# Persistent dirty bitmaps require compat=3D1.1 +_unsupported_imgopts 'compat=3D0.10' =20 function run_qemu() { --=20 2.13.6