All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] blockdev: unset inappropriate flags when changing medium
@ 2016-02-06 13:36 Alyssa Milburn
  2016-02-06 14:39 ` [Qemu-devel] [Qemu-block] " Max Reitz
  0 siblings, 1 reply; 2+ messages in thread
From: Alyssa Milburn @ 2016-02-06 13:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Markus Armbruster, qemu-block

Most importantly, this removes BDRV_O_TEMPORARY, to avoid unlink()ing an
image which replaces a snapshotted one.

Signed-off-by: Alyssa Milburn <fuzzie@fuzzie.org>
---
 blockdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/blockdev.c b/blockdev.c
index be4ca44..a916b06 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2514,6 +2514,8 @@ void qmp_blockdev_change_medium(const char *device, const char *filename,
     }
 
     bdrv_flags = blk_get_open_flags_from_root_state(blk);
+    bdrv_flags &= ~(BDRV_O_TEMPORARY | BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING |
+        BDRV_O_PROTOCOL);
 
     if (!has_read_only) {
         read_only = BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-06 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-06 13:36 [Qemu-devel] [PATCH v2] blockdev: unset inappropriate flags when changing medium Alyssa Milburn
2016-02-06 14:39 ` [Qemu-devel] [Qemu-block] " Max Reitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.