From nobody Mon Apr 14 04:07:10 2025 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 1513608606675736.1562822719611; Mon, 18 Dec 2017 06:50:06 -0800 (PST) Received: from localhost ([::1]:41503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQwjx-0001Nq-JH for importer@patchew.org; Mon, 18 Dec 2017 09:50:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQwXf-0007Nm-CK for qemu-devel@nongnu.org; Mon, 18 Dec 2017 09:37:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQwXe-0007wJ-4Q for qemu-devel@nongnu.org; Mon, 18 Dec 2017 09:37:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33948) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eQwXd-0007uf-5I for qemu-devel@nongnu.org; Mon, 18 Dec 2017 09:37:18 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5CE1A4A6E5; Mon, 18 Dec 2017 14:37:16 +0000 (UTC) Received: from localhost (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3CCA84D10; Mon, 18 Dec 2017 14:37:15 +0000 (UTC) From: Stefan Hajnoczi To: Date: Mon, 18 Dec 2017 14:35:30 +0000 Message-Id: <20171218143530.12082-24-stefanha@redhat.com> In-Reply-To: <20171218143530.12082-1-stefanha@redhat.com> References: <20171218143530.12082-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 18 Dec 2017 14:37:16 +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/23] qemu-iotests: add 203 savevm with IOThreads 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: Peter Maydell , Stefan Hajnoczi 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" This test case will prevent future regressions with savevm and IOThreads. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-id: 20171207201320.19284-7-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/203 | 59 ++++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/203.out | 6 +++++ tests/qemu-iotests/group | 1 + 3 files changed, 66 insertions(+) create mode 100755 tests/qemu-iotests/203 create mode 100644 tests/qemu-iotests/203.out diff --git a/tests/qemu-iotests/203 b/tests/qemu-iotests/203 new file mode 100755 index 0000000000..2c811917d8 --- /dev/null +++ b/tests/qemu-iotests/203 @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# +# Copyright (C) 2017 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: Stefan Hajnoczi +# +# Check that QMP 'migrate' with multiple drives on a single IOThread compl= etes +# successfully. This particular command triggered a hang in the source QE= MU +# process due to recursive AioContext locking in bdrv_invalidate_all() and +# BDRV_POLL_WHILE(). + +import iotests + +iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.verify_platform(['linux']) + +with iotests.FilePath('disk0.img') as disk0_img_path, \ + iotests.FilePath('disk1.img') as disk1_img_path, \ + iotests.VM() as vm: + + img_size =3D '10M' + iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk0_img_path, = img_size) + iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk1_img_path, = img_size) + + iotests.log('Launching VM...') + (vm.add_object('iothread,id=3Diothread0') + .add_drive(disk0_img_path, 'node-name=3Ddrive0-node', interface=3D'= none') + .add_drive(disk1_img_path, 'node-name=3Ddrive1-node', interface=3D'= none') + .launch()) + + iotests.log('Setting IOThreads...') + iotests.log(vm.qmp('x-blockdev-set-iothread', + node_name=3D'drive0-node', iothread=3D'iothread0', + force=3DTrue)) + iotests.log(vm.qmp('x-blockdev-set-iothread', + node_name=3D'drive1-node', iothread=3D'iothread0', + force=3DTrue)) + + iotests.log('Starting migration...') + iotests.log(vm.qmp('migrate', uri=3D'exec:cat >/dev/null')) + while True: + vm.get_qmp_event(wait=3D60.0) + result =3D vm.qmp('query-migrate') + status =3D result.get('return', {}).get('status', None) + if status =3D=3D 'completed': + break diff --git a/tests/qemu-iotests/203.out b/tests/qemu-iotests/203.out new file mode 100644 index 0000000000..3f1ff900e4 --- /dev/null +++ b/tests/qemu-iotests/203.out @@ -0,0 +1,6 @@ +Launching VM... +Setting IOThreads... +{u'return': {}} +{u'return': {}} +Starting migration... +{u'return': {}} diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index d0ee1e2e55..93d96fb22f 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -198,3 +198,4 @@ 198 rw auto 200 rw auto 202 rw auto quick +203 rw auto --=20 2.14.3