From 42539f0839faf9bca930bed226d7f009fa554f6e Mon Sep 17 00:00:00 2001 From: John Snow Date: Mon, 19 Sep 2016 18:16:11 +0200 Subject: [PATCH 18/18] qemu: use bdrv_flush_all for vm_stop et al RH-Author: John Snow Message-id: <1474308971-28285-3-git-send-email-jsnow@redhat.com> Patchwork-id: 72380 O-Subject: [RHEV-7.3 qemu-kvm-rhev PATCH 2/2] qemu: use bdrv_flush_all for vm_stop et al Bugzilla: 1338638 RH-Acked-by: Max Reitz RH-Acked-by: Markus Armbruster RH-Acked-by: Kevin Wolf Reimplement bdrv_flush_all for vm_stop. In contrast to blk_flush_all, bdrv_flush_all does not have device model restrictions. This allows us to flush and halt unconditionally without error. This allows us to do things like migrate when we have a device with an open tray, but has a node that may need to be flushed, or nodes that aren't currently attached to any device and need to be flushed. Specifically, this allows us to migrate when we have a CDROM with an open tray. Signed-off-by: John Snow Reviewed-by: Kevin Wolf (cherry picked from commit f81d28d428875b7bc75f1dfeabe3ba28c34134d8) Signed-off-by: John Snow Note: Commit hash can be incorrect due early commit (due to deadline) Signed-off-by: Miroslav Rezanina --- cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index c826954..c202019 100644 --- a/cpus.c +++ b/cpus.c @@ -743,7 +743,7 @@ static int do_vm_stop(RunState state) } bdrv_drain_all(); - ret = blk_flush_all(); + ret = bdrv_flush_all(); return ret; } @@ -1486,7 +1486,7 @@ int vm_stop_force_state(RunState state) bdrv_drain_all(); /* Make sure to return an error if the flush in a previous vm_stop() * failed. */ - return blk_flush_all(); + return bdrv_flush_all(); } } -- 1.8.3.1