On 09.06.2015 18:50, Stefan Hajnoczi wrote:
On Mon, Jun 08, 2015 at 06:21:24PM +0300, Vladimir Sementsov-Ogievskiy wrote:
diff --git a/block/qcow2.c b/block/qcow2.c
index 406e55d..f85a55a 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -182,6 +182,14 @@ static int qcow2_read_extensions(BlockDriverState *bs, 
uint64_t start_offset,
                  return ret;
              }
+ if (!(s->autoclear_features & QCOW2_AUTOCLEAR_DIRTY_BITMAPS) &&
+                s->nb_dirty_bitmaps > 0) {
+                ret = qcow2_delete_all_dirty_bitmaps(bs, errp);
+                if (ret < 0) {
+                    return ret;
+                }
+            }
+
What if the file is read-only?

We shouldn't modify the file in qcow2_read_extensions().
But where? In qcow2_open? Or nowhere? I think auto clear extensions should be cleared automatically..

--
Best regards,
Vladimir
* now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience.


Reply via email to