From patchwork Fri Apr 24 15:01:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 464231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 09DBE140134 for ; Sat, 25 Apr 2015 01:07:25 +1000 (AEST) Received: from localhost ([::1]:45243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlfCM-00057v-T3 for incoming@patchwork.ozlabs.org; Fri, 24 Apr 2015 11:07:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylf7K-0004Ac-Lh for qemu-devel@nongnu.org; Fri, 24 Apr 2015 11:02:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ylf7G-0006H1-0K for qemu-devel@nongnu.org; Fri, 24 Apr 2015 11:02:10 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:51751 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylf7F-0006EX-QA; Fri, 24 Apr 2015 11:02:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AucFALVZOlVbdWOb/2dsb2JhbABbgwyBLrRoBAUBgQKYPQKBPUwBAQEBAQGBC4QhAQEEeRBRPBsZiC8BzBoBAQgihhaJTVgHFoQXBYZChRaQM5VVI2CBBYISOzGBA4FBAQEB X-IPAS-Result: AucFALVZOlVbdWOb/2dsb2JhbABbgwyBLrRoBAUBgQKYPQKBPUwBAQEBAQGBC4QhAQEEeRBRPBsZiC8BzBoBAQgihhaJTVgHFoQXBYZChRaQM5VVI2CBBYISOzGBA4FBAQEB X-IronPort-AV: E=Sophos;i="5.11,640,1422918000"; d="scan'208";a="345267717" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 24 Apr 2015 17:02:00 +0200 Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com) by fanzine.igalia.com with esmtps (Cipher TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim) id 1Ylf7A-0004vj-I0; Fri, 24 Apr 2015 17:02:00 +0200 Received: from fanzine.local.igalia.com ([192.168.10.13] helo=perseus.local) by mail.igalia.com with esmtps (Cipher TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim) id 1Ylf79-0007GQ-9O; Fri, 24 Apr 2015 17:01:59 +0200 Received: from berto by perseus.local with local (Exim 4.84) (envelope-from ) id 1Ylf78-0005Vi-0T; Fri, 24 Apr 2015 18:01:58 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 24 Apr 2015 18:01:55 +0300 Message-Id: <340096a34fa92ed242c70f1022860a6a8fa528a0.1429885069.git.berto@igalia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 11/11] qemu-iotests: test overlapping block-stream operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This test case checks that it's not possible to perform two block-stream operations if there are nodes involved in both. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- tests/qemu-iotests/030 | 27 +++++++++++++++++++++++++++ tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index c199cef..f898c92 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -225,6 +225,33 @@ class TestParallelOps(iotests.QMPTestCase): qemu_io('-f', iotests.imgfmt, '-c', 'map', self.imgs[i-1]), 'image file map does not match backing file after streaming') + # Test that it's not possible to perform two block-stream + # operations if there are nodes involved in both. + def test_stream_overlapping(self): + self.assert_no_active_block_jobs() + + # Set a speed limit to make sure that this job blocks the rest + result = self.vm.qmp('block-stream', device='node4', base=self.imgs[0], speed=32768) + self.assert_qmp(result, 'return', {}) + + result = self.vm.qmp('block-stream', device='node5', base=self.imgs[1]) + self.assert_qmp(result, 'error/class', 'GenericError') + + result = self.vm.qmp('block-stream', device='node3', base=self.imgs[2]) + self.assert_qmp(result, 'error/class', 'GenericError') + + result = self.vm.qmp('block-stream', device='node4') + self.assert_qmp(result, 'error/class', 'GenericError') + + # If node4 is the active node, the id of the block job is drive0 + if self.num_imgs == 5: + self.wait_until_completed(drive='drive0') + else: + self.wait_until_completed(drive='node4') + self.assert_no_active_block_jobs() + + self.vm.shutdown() + class TestSmallerBackingFile(iotests.QMPTestCase): backing_len = 1 * 1024 * 1024 # MB image_len = 2 * backing_len diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out index b6f2576..52d796e 100644 --- a/tests/qemu-iotests/030.out +++ b/tests/qemu-iotests/030.out @@ -1,5 +1,5 @@ -................ +................. ---------------------------------------------------------------------- -Ran 16 tests +Ran 17 tests OK