From patchwork Thu Aug 17 06:25:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9905039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9443260386 for ; Thu, 17 Aug 2017 06:31:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 862CB28AA8 for ; Thu, 17 Aug 2017 06:31:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AD7128AAB; Thu, 17 Aug 2017 06:31:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 933E828AB5 for ; Thu, 17 Aug 2017 06:31:10 +0000 (UTC) Received: from localhost ([::1]:35124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diEKM-00054a-CI for patchwork-qemu-devel@patchwork.kernel.org; Thu, 17 Aug 2017 02:30:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diEFb-0001t0-5V for qemu-devel@nongnu.org; Thu, 17 Aug 2017 02:25:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diEFY-00070b-0x for qemu-devel@nongnu.org; Thu, 17 Aug 2017 02:25:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60214) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diEFX-0006yF-O6 for qemu-devel@nongnu.org; Thu, 17 Aug 2017 02:25:47 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 98F652DE41E; Thu, 17 Aug 2017 06:25:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 98F652DE41E Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.redhat.com (ovpn-116-57.ams2.redhat.com [10.36.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99AF85C882; Thu, 17 Aug 2017 06:25:36 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Cornelia Huck , Christian Borntraeger Date: Thu, 17 Aug 2017 08:25:10 +0200 Message-Id: <1502951113-4246-4-git-send-email-thuth@redhat.com> In-Reply-To: <1502951113-4246-1-git-send-email-thuth@redhat.com> References: <1502951113-4246-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 17 Aug 2017 06:25:46 +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] [PATCH 3/6] tests: Enable the drive_del test also on s390x 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: Eric Farman , Janosch Frank , Halil Pasic , Yi Min Zhao , Jason J Herne , David Hildenbrand , Pierre Morel , Farhan Ali , Jing Liu , Fan Zhang , Claudio Imbrenda , QingFeng Hao , Michael S Tsirkin , Xiao Feng Ren , Fei Li , Cleber Rosa , Dong Jia Shi , Yang Chen , Marc Mari Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP By using the "virtio-xxx" device name aliases instead of the "virtio-xxx-pci" names, we can use this test on s390x, too, to check that adding and deleting also works fine with the virtio-ccw bus. Signed-off-by: Thomas Huth Tested-by: Cleber Rosa --- tests/Makefile.include | 1 + tests/drive_del-test.c | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 0bb18b3..ff2a551 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -363,6 +363,7 @@ check-qtest-s390x-y = tests/boot-serial-test$(EXESUF) check-qtest-s390x-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF) check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF) check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF) +check-qtest-s390x-y += tests/drive_del-test$(EXESUF) check-qtest-generic-y += tests/qom-test$(EXESUF) check-qtest-generic-y += tests/test-hmp$(EXESUF) diff --git a/tests/drive_del-test.c b/tests/drive_del-test.c index 2175139..efceb31 100644 --- a/tests/drive_del-test.c +++ b/tests/drive_del-test.c @@ -65,12 +65,12 @@ static void test_after_failed_device_add(void) qtest_start("-drive if=none,id=drive0"); - /* Make device_add fail. If this leaks the virtio-blk-pci device then a + /* Make device_add fail. If this leaks the virtio-blk device then a * reference to drive0 will also be held (via qdev properties). */ response = qmp("{'execute': 'device_add'," " 'arguments': {" - " 'driver': 'virtio-blk-pci'," + " 'driver': 'virtio-blk'," " 'drive': 'drive0'" "}}"); g_assert(response); @@ -82,7 +82,7 @@ static void test_after_failed_device_add(void) drive_del(); /* Try to re-add the drive. This fails with duplicate IDs if a leaked - * virtio-blk-pci exists that holds a reference to the old drive0. + * virtio-blk exists that holds a reference to the old drive0. */ drive_add(); @@ -93,7 +93,7 @@ static void test_drive_del_device_del(void) { /* Start with a drive used by a device that unplugs instantaneously */ qtest_start("-drive if=none,id=drive0,file=null-co://,format=raw" - " -device virtio-scsi-pci" + " -device virtio-scsi" " -device scsi-hd,drive=drive0,id=dev0"); /* @@ -114,9 +114,10 @@ int main(int argc, char **argv) qtest_add_func("/drive_del/without-dev", test_drive_without_dev); - /* TODO I guess any arch with PCI would do */ + /* TODO I guess any arch with a hot-pluggable virtio bus would do */ if (!strcmp(arch, "i386") || !strcmp(arch, "x86_64") || - !strcmp(arch, "ppc") || !strcmp(arch, "ppc64")) { + !strcmp(arch, "ppc") || !strcmp(arch, "ppc64") || + !strcmp(arch, "s390x")) { qtest_add_func("/drive_del/after_failed_device_add", test_after_failed_device_add); qtest_add_func("/blockdev/drive_del_device_del",