From patchwork Fri Oct 19 16:30:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 10649763 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 AAACD15E2 for ; Fri, 19 Oct 2018 16:32:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98248283B1 for ; Fri, 19 Oct 2018 16:32:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C7FC284E9; Fri, 19 Oct 2018 16:32:36 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 0967C283B1 for ; Fri, 19 Oct 2018 16:32:36 +0000 (UTC) Received: from localhost ([::1]:51519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDXhT-0004BO-Cv for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Oct 2018 12:32:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDXfb-0002uc-5h for qemu-devel@nongnu.org; Fri, 19 Oct 2018 12:30:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDXfW-00020x-Jw for qemu-devel@nongnu.org; Fri, 19 Oct 2018 12:30:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34232) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDXfL-0001j0-AP; Fri, 19 Oct 2018 12:30:23 -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 12E7730C9F1A; Fri, 19 Oct 2018 16:30:18 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-137.ams2.redhat.com [10.36.117.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A7F287C5; Fri, 19 Oct 2018 16:30:16 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 18:30:04 +0200 Message-Id: <20181019163013.11787-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.42]); Fri, 19 Oct 2018 16:30:18 +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] [PATCH v4 00/11] block: Add auto-read-only option 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, pkrempa@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP See patch 2 for an explanation of the motivation. v4: - Split fix for missing rbd_close() into a separate patch [Eric] - Added qemu-iotests case v3: - Clarified QAPI schema documentation that auto-read-only can only degrade read-write to read-only, not the other way round [Eric] - Don't refuse to set copy-on-read=on and auto-read-only=on at the same time; only complain when actually trying to degrade to read-only - Let bdrv_apply_auto_read_only() return -EACCESS on all errors - Fixed file-posix and gluster implementations [Eric, Niels] - Added a patch to make auto-read-only=on the default for human user interfaces (-drive/-hda/...) v2: - Turn bdrv_set_read_only() into bdrv_apply_auto_read_only() - Support the option in a lot more block drivers Kevin Wolf (11): block: Update flags in bdrv_set_read_only() block: Add auto-read-only option rbd: Close image in qemu_rbd_open() error path block: Require auto-read-only for existing fallbacks nbd: Support auto-read-only option file-posix: Support auto-read-only option curl: Support auto-read-only option gluster: Support auto-read-only option iscsi: Support auto-read-only option block: Make auto-read-only=on default for -drive qemu-iotests: Test auto-read-only with -drive and -blockdev qapi/block-core.json | 7 ++ include/block/block.h | 5 +- block.c | 54 +++++++++++--- block/bochs.c | 17 ++--- block/cloop.c | 16 ++-- block/curl.c | 8 +- block/dmg.c | 16 ++-- block/file-posix.c | 19 ++++- block/gluster.c | 12 ++- block/iscsi.c | 8 +- block/nbd-client.c | 10 +-- block/rbd.c | 14 +--- block/vvfat.c | 11 +-- blockdev.c | 1 + tests/qemu-iotests/232 | 147 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/232.out | 59 +++++++++++++++ tests/qemu-iotests/group | 1 + 17 files changed, 327 insertions(+), 78 deletions(-) create mode 100755 tests/qemu-iotests/232 create mode 100644 tests/qemu-iotests/232.out