From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCW7H-0003id-CL for qemu-devel@nongnu.org; Mon, 13 Jun 2016 13:57:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCW7F-0007Os-Dq for qemu-devel@nongnu.org; Mon, 13 Jun 2016 13:57:38 -0400 References: <1465595961-4762-1-git-send-email-jsnow@redhat.com> <575B4268.7080501@redhat.com> From: John Snow Message-ID: <1f901da0-d30d-76ef-f417-ee61d74bc421@redhat.com> Date: Mon, 13 Jun 2016 13:57:27 -0400 MIME-Version: 1.0 In-Reply-To: <575B4268.7080501@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block-backend: allow flush on devices with open tray List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com On 06/10/2016 06:42 PM, Eric Blake wrote: > On 06/10/2016 03:59 PM, John Snow wrote: >> 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 >> --- >> block/block-backend.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > Worth testsuite coverage to prevent future regressions? > I'll look into it. (Ugh, migration tests. wah. etc.) --js > At any rate, > Reviewed-by: Eric Blake > >> >> 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; >> } >> >> >