All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block-backend: allow flush on devices with open tray
@ 2016-06-10 21:59 John Snow
  2016-06-10 22:42 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: John Snow @ 2016-06-10 21:59 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel, mreitz, John Snow

If a device still has an attached BDS because the medium has not yet
been removed, we will be unable to migrate to a new host because
blk_flush will return an error for that backend.

Replace the call to blk_is_available to blk_is_inserted to weaken
the check and allow flushes from the backend to work, while still
disallowing flushes from the frontend/device model to work.

This fixes a regression present in 2.6.0 caused by the following commit:
fe1a9cbc339bb54d20f1ca4c1e8788d16944d5cf
block: Move some bdrv_*_all() functions to BB

Signed-off-by: John Snow <jsnow@redhat.com>
---
 block/block-backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/block-backend.c b/block/block-backend.c
index 34500e6..d1e875e 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1122,7 +1122,7 @@ int blk_co_flush(BlockBackend *blk)
 
 int blk_flush(BlockBackend *blk)
 {
-    if (!blk_is_available(blk)) {
+    if (!blk_is_inserted(blk)) {
         return -ENOMEDIUM;
     }
 
-- 
2.4.11

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

end of thread, other threads:[~2016-06-15  7:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10 21:59 [Qemu-devel] [PATCH] block-backend: allow flush on devices with open tray John Snow
2016-06-10 22:42 ` Eric Blake
2016-06-13 17:57   ` John Snow
2016-06-12  2:26 ` Fam Zheng
2016-06-14 13:19 ` Max Reitz
2016-06-14 15:54   ` John Snow
2016-06-14 16:13     ` Max Reitz
2016-06-15  7:51       ` Kevin Wolf

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.