From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:56765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzo5I-0006Yv-7k for qemu-devel@nongnu.org; Fri, 01 Mar 2019 14:44:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzo5G-0008UO-9X for qemu-devel@nongnu.org; Fri, 01 Mar 2019 14:44:40 -0500 References: <20190301191545.8728-1-jsnow@redhat.com> <20190301191545.8728-2-jsnow@redhat.com> <98d945ac-a57b-eb0d-7bb8-319675834c61@redhat.com> From: John Snow Message-ID: <8ae01183-ee35-545d-0866-2d6ff27f8003@redhat.com> Date: Fri, 1 Mar 2019 14:44:24 -0500 MIME-Version: 1.0 In-Reply-To: <98d945ac-a57b-eb0d-7bb8-319675834c61@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/7] block/dirty-bitmaps: add inconsistent bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: Fam Zheng , Kevin Wolf , vsementsov@virtuozzo.com, Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Max Reitz On 3/1/19 2:32 PM, Eric Blake wrote: > On 3/1/19 1:15 PM, John Snow wrote: >> Add an inconsistent bit to dirty-bitmaps that allows us to report a bitmap as >> persistent but potentially inconsistent, i.e. if we find bitmaps on a qcow2 >> that have been marked as "in use". >> >> Signed-off-by: John Snow >> --- >> qapi/block-core.json | 13 +++++++++---- >> include/block/dirty-bitmap.h | 2 ++ >> block/dirty-bitmap.c | 19 +++++++++++++++++++ >> 3 files changed, 30 insertions(+), 4 deletions(-) >> >> diff --git a/qapi/block-core.json b/qapi/block-core.json >> index 6e543594b3..e639ef6d1c 100644 >> --- a/qapi/block-core.json >> +++ b/qapi/block-core.json >> @@ -467,15 +467,20 @@ >> # and cannot be modified via QMP or used by another operation. >> # Replaces `locked` and `frozen` statuses. (since 4.0) >> # >> -# @persistent: true if the bitmap will eventually be flushed to persistent >> -# storage (since 4.0) >> +# @persistent: true if the bitmap was stored on disk, is scheduled to be stored >> +# on disk, or both. (since 4.0) >> +# >> +# @inconsistent: true if this is a persistent bitmap that was improperly >> +# stored. Implies @persistent to be true; @recording and >> +# @busy to be false. This bitmap cannot be used. To remove >> +# it, use @block-dirty-bitmap-remove. (Since 4.0) >> # > > I know we waffled on word-smithing this, but this turned out nicely. > Yes, I think so too. > >> >> +/* Called with BQL taken. */ >> +void bdrv_dirty_bitmap_set_inconsistent(BdrvDirtyBitmap *bitmap) >> +{ >> + qemu_mutex_lock(bitmap->mutex); >> + bitmap->inconsistent = true; >> + bitmap->disabled = true; >> + qemu_mutex_unlock(bitmap->mutex); > > Worth an assert that persistent is true? Either way, > Won't hurt. > Reviewed-by: Eric Blake >