From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLcoX-0000yd-ML for qemu-devel@nongnu.org; Wed, 11 Feb 2015 14:19:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLcoU-0002g7-2o for qemu-devel@nongnu.org; Wed, 11 Feb 2015 14:19:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLcoT-0002fw-R7 for qemu-devel@nongnu.org; Wed, 11 Feb 2015 14:19:06 -0500 Message-ID: <54DBAB25.4060602@redhat.com> Date: Wed, 11 Feb 2015 14:19:01 -0500 From: John Snow MIME-Version: 1.0 References: <1423532117-14490-1-git-send-email-jsnow@redhat.com> <1423532117-14490-11-git-send-email-jsnow@redhat.com> <54DBA923.1090006@redhat.com> In-Reply-To: <54DBA923.1090006@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v12 10/17] qmp: Add dirty bitmap status fields in query-block List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, armbru@redhat.com, vsementsov@parallels.com, stefanha@redhat.com On 02/11/2015 02:10 PM, Max Reitz wrote: > On 2015-02-09 at 20:35, John Snow wrote: >> Adds the "disabled" and "frozen" status booleans. >> >> Signed-off-by: Fam Zheng >> Signed-off-by: John Snow >> --- >> block.c | 2 ++ >> qapi/block-core.json | 7 ++++++- >> 2 files changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/block.c b/block.c >> index ad33d96..3c0989c 100644 >> --- a/block.c >> +++ b/block.c >> @@ -5564,6 +5564,8 @@ BlockDirtyInfoList >> *bdrv_query_dirty_bitmaps(BlockDriverState *bs) >> info->granularity =3D bdrv_dirty_bitmap_granularity(bm); >> info->has_name =3D !!bm->name; >> info->name =3D g_strdup(bm->name); >> + info->disabled =3D bm->disabled; > > Hm, this is different than !bdrv_dirty_bitmap_enabled(), but I can > understand the reasoning if the difference is intended. > > Therefore, as long as it's intended: > > Reviewed-by: Max Reitz > Yes, since I am exposing the frozen condition as well, so that error=20 messages aren't opaque: "Something is busy, sorry, go away." At least=20 with this you can check what conditions are preventing operations from=20 completing. info->disabled was meant to expose only the user-controlled "on/off" stat= es. >> + info->frozen =3D bdrv_dirty_bitmap_frozen(bm); >> entry->value =3D info; >> *plist =3D entry; >> plist =3D &entry->next; >> diff --git a/qapi/block-core.json b/qapi/block-core.json >> index 702b76a..c5d5563 100644 >> --- a/qapi/block-core.json >> +++ b/qapi/block-core.json >> @@ -332,10 +332,15 @@ >> # >> # @granularity: granularity of the dirty bitmap in bytes (since 1.4) >> # >> +# @disabled: whether the dirty bitmap is disabled (Since 2.3) >> +# >> +# @frozen: whether the dirty bitmap is frozen (Since 2.3) >> +# >> # Since: 1.3 >> ## >> { 'type': 'BlockDirtyInfo', >> - 'data': {'*name': 'str', 'count': 'int', 'granularity': 'int'} } >> + 'data': {'*name': 'str', 'count': 'int', 'granularity': 'int', >> + 'disabled': 'bool', 'frozen': 'bool'} } >> ## >> # @BlockInfo: > --=20 =E2=80=94js