From patchwork Fri Apr 12 16:04:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 10898691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17F87922 for ; Fri, 12 Apr 2019 16:08:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F36C6285C8 for ; Fri, 12 Apr 2019 16:08:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E74BA28E95; Fri, 12 Apr 2019 16:08:46 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E2D2A28AD6 for ; Fri, 12 Apr 2019 16:08:42 +0000 (UTC) Received: from localhost ([127.0.0.1]:39495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEyjK-0007DN-4D for patchwork-qemu-devel@patchwork.kernel.org; Fri, 12 Apr 2019 12:08:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEyg3-0004f2-66 for qemu-devel@nongnu.org; Fri, 12 Apr 2019 12:05:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEyg1-0002IM-Ly for qemu-devel@nongnu.org; Fri, 12 Apr 2019 12:05:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50252) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hEyfw-0002B5-Ul; Fri, 12 Apr 2019 12:05:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5163D30B4A38; Fri, 12 Apr 2019 16:05:08 +0000 (UTC) Received: from linux.fritz.box.com (unknown [10.36.118.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id E857C6134A; Fri, 12 Apr 2019 16:05:05 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Fri, 12 Apr 2019 18:04:57 +0200 Message-Id: <20190412160458.23920-2-kwolf@redhat.com> In-Reply-To: <20190412160458.23920-1-kwolf@redhat.com> References: <20190412160458.23920-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 12 Apr 2019 16:05:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/2] iotests: Let 245 pass on tmpfs 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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Max Reitz tmpfs does not support O_DIRECT. Detect this case, and skip flipping @direct if the filesystem does not support it. Fixes: bf3e50f6239090e63a8ffaaec971671e66d88e07 Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tests/qemu-iotests/245 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index 7891a210c1..a04c6235c1 100644 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -209,6 +209,12 @@ class TestBlockdevReopen(iotests.QMPTestCase): # Reopen an image several times changing some of its options def test_reopen(self): + # Check whether the filesystem supports O_DIRECT + if 'O_DIRECT' in qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit', hd_path[0]): + supports_direct = False + else: + supports_direct = True + # Open the hd1 image passing all backing options opts = hd_opts(1) opts['backing'] = hd_opts(0) @@ -231,9 +237,9 @@ class TestBlockdevReopen(iotests.QMPTestCase): self.assert_qmp(self.get_node('hd1'), 'cache/writeback', True) self.assert_qmp(self.get_node('hd1'), 'cache/direct', False) self.assert_qmp(self.get_node('hd1'), 'cache/no-flush', False) - self.reopen(opts, {'cache': { 'direct': True, 'no-flush': True }}) + self.reopen(opts, {'cache': { 'direct': supports_direct, 'no-flush': True }}) self.assert_qmp(self.get_node('hd1'), 'cache/writeback', True) - self.assert_qmp(self.get_node('hd1'), 'cache/direct', True) + self.assert_qmp(self.get_node('hd1'), 'cache/direct', supports_direct) self.assert_qmp(self.get_node('hd1'), 'cache/no-flush', True) # Reopen again with the original options