qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH v13 03/20] block: Don't require BLK_PERM_CONSISTENT_


From: Fam Zheng
Subject: [Qemu-block] [PATCH v13 03/20] block: Don't require BLK_PERM_CONSISTENT_READ when unsafe open
Date: Thu, 20 Apr 2017 15:52:20 +0800

Signed-off-by: Fam Zheng <address@hidden>
---
 block.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block.c b/block.c
index f5182d8..ac0527a 100644
--- a/block.c
+++ b/block.c
@@ -2372,7 +2372,9 @@ static BlockDriverState *bdrv_open_inherit(const char 
*filename,
             goto fail;
         }
         if (file_bs != NULL) {
-            file = blk_new(BLK_PERM_CONSISTENT_READ, BLK_PERM_ALL);
+            file = blk_new(flags & BDRV_O_UNSAFE_READ ?
+                               0 : BLK_PERM_CONSISTENT_READ,
+                           BLK_PERM_ALL);
             blk_insert_bs(file, file_bs, &local_err);
             bdrv_unref(file_bs);
             if (local_err) {
-- 
2.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]