From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1Efo-0004Gm-Lb for qemu-devel@nongnu.org; Mon, 31 Oct 2016 11:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1Efn-0004w4-W1 for qemu-devel@nongnu.org; Mon, 31 Oct 2016 11:38:56 -0400 From: Fam Zheng Date: Mon, 31 Oct 2016 23:38:23 +0800 Message-Id: <1477928314-11184-4-git-send-email-famz@redhat.com> In-Reply-To: <1477928314-11184-1-git-send-email-famz@redhat.com> References: <1477928314-11184-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 03/14] qemu-io: Set "share-rw" flag together with read-only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Daniel P. Berrange" , Kevin Wolf , Max Reitz , qemu-block@nongnu.org, rjones@redhat.com qemu-io is a low level tool to read or modify guest visible data, which implies the user knows very well what is being done. Allowing reading from a locked image is harmless in most cases, so do it. Signed-off-by: Fam Zheng --- qemu-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu-io.c b/qemu-io.c index 23a229f..f000504 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -585,6 +585,8 @@ int main(int argc, char **argv) /* open the device */ if (!readonly) { flags |= BDRV_O_RDWR; + } else { + flags |= BDRV_O_SHARE_RW; } if ((argc - optind) == 1) { -- 2.7.4