From patchwork Thu Nov 22 18:48:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Shinkevich X-Patchwork-Id: 1001936 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4317l165lXz9s0t for ; Fri, 23 Nov 2018 05:49:01 +1100 (AEDT) Received: from localhost ([::1]:48921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPu27-0003Rs-Dn for incoming@patchwork.ozlabs.org; Thu, 22 Nov 2018 13:48:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPu1S-0003O5-Jw for qemu-devel@nongnu.org; Thu, 22 Nov 2018 13:48:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPu1P-00073c-ET for qemu-devel@nongnu.org; Thu, 22 Nov 2018 13:48:18 -0500 Received: from relay.sw.ru ([185.231.240.75]:48756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPu1P-0006zx-4Z; Thu, 22 Nov 2018 13:48:15 -0500 Received: from [172.16.25.136] (helo=localhost.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gPu1J-0006jl-5L; Thu, 22 Nov 2018 21:48:09 +0300 From: Andrey Shinkevich To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Thu, 22 Nov 2018 21:48:06 +0300 Message-Id: <1542912487-279165-5-git-send-email-andrey.shinkevich@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1542912487-279165-1-git-send-email-andrey.shinkevich@virtuozzo.com> References: <1542912487-279165-1-git-send-email-andrey.shinkevich@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH 4/5] iotests: prepare 030 for graph change 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, vsementsov@virtuozzo.com, jcody@redhat.com, armbru@redhat.com, dgilbert@redhat.com, andrey.shinkevich@virtuozzo.com, den@openvz.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The discard option for block-stream command requires insertion of the filter to write into the backing chain. In that case, the job will not resume by device name. So, the node name is specified. Signed-off-by: Andrey Shinkevich --- tests/qemu-iotests/030 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 276e06b..5d148b0 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -36,7 +36,8 @@ class TestSingleDrive(iotests.QMPTestCase): qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img) qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 512', backing_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 524288 512', mid_img) - self.vm = iotests.VM().add_drive("blkdebug::" + test_img, "backing.node-name=mid") + self.vm = iotests.VM().add_drive("blkdebug::" + test_img, + "node-name=source,backing.node-name=mid") self.vm.launch() def tearDown(self): @@ -87,7 +88,7 @@ class TestSingleDrive(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) self.pause_job('drive0', wait=False) - self.vm.resume_drive('drive0') + self.vm.resume_drive('source') self.pause_wait('drive0') result = self.vm.qmp('query-block-jobs') @@ -743,7 +744,8 @@ class TestStreamStop(iotests.QMPTestCase): qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 32M', backing_img) qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 32M 32M', test_img) - self.vm = iotests.VM().add_drive("blkdebug::" + test_img) + self.vm = iotests.VM().add_drive("blkdebug::" + test_img, + "node-name=source") self.vm.launch() def tearDown(self): @@ -764,7 +766,7 @@ class TestStreamStop(iotests.QMPTestCase): self.assert_qmp(e, 'event', 'JOB_STATUS_CHANGE') self.assert_qmp(e, 'data/id', 'drive0') - self.cancel_and_wait(resume=True) + self.cancel_and_wait(resume=True, resume_node='source') class TestSetSpeed(iotests.QMPTestCase): image_len = 80 * 1024 * 1024 # MB @@ -774,7 +776,8 @@ class TestSetSpeed(iotests.QMPTestCase): qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 32M', backing_img) qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 32M 32M', test_img) - self.vm = iotests.VM().add_drive('blkdebug::' + test_img) + self.vm = iotests.VM().add_drive('blkdebug::' + test_img, + "node-name=source") self.vm.launch() def tearDown(self): @@ -817,7 +820,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_qmp(result, 'return[0]/device', 'drive0') self.assert_qmp(result, 'return[0]/speed', 8 * 1024 * 1024) - self.cancel_and_wait(resume=True) + self.cancel_and_wait(resume=True, resume_node='source') self.vm.pause_drive('drive0') # Check setting speed in block-stream works @@ -828,7 +831,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_qmp(result, 'return[0]/device', 'drive0') self.assert_qmp(result, 'return[0]/speed', 4 * 1024 * 1024) - self.cancel_and_wait(resume=True) + self.cancel_and_wait(resume=True, resume_node='source') def test_set_speed_invalid(self): self.assert_no_active_block_jobs() @@ -845,7 +848,8 @@ class TestSetSpeed(iotests.QMPTestCase): result = self.vm.qmp('block-job-set-speed', device='drive0', speed=-1) self.assert_qmp(result, 'error/class', 'GenericError') - self.cancel_and_wait(resume=True) + self.cancel_and_wait(resume=True, resume_node='source') + if __name__ == '__main__': iotests.main(supported_fmts=['qcow2', 'qed'])