From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyfJQ-0007cY-JF for qemu-devel@nongnu.org; Wed, 21 Mar 2018 11:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyfJP-0003gH-Nf for qemu-devel@nongnu.org; Wed, 21 Mar 2018 11:06:00 -0400 References: <20180321121940.39426-1-vsementsov@virtuozzo.com> <20180321121940.39426-3-vsementsov@virtuozzo.com> From: Eric Blake Message-ID: Date: Wed, 21 Mar 2018 10:05:53 -0500 MIME-Version: 1.0 In-Reply-To: <20180321121940.39426-3-vsementsov@virtuozzo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] nbd/server: add nbd_meta_single_query helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: armbru@redhat.com, mreitz@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, den@openvz.org On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote: > The helper will be reused for bitmaps namespace. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > nbd/server.c | 41 ++++++++++++++++++++++++++++------------- > 1 file changed, 28 insertions(+), 13 deletions(-) > > +/* Read len bytes and check matching to the pattern. > + * @match is set to true on empty query for _LIST_ and for query matching the > + * @pattern. @match is never set to false. How about: Read @len bytes, and set @match to true if they match @pattern, or if @len is 0 and the client is performing _LIST_. @match is never set to false. At any rate, the refactoring is sane; and comment touchups are trivial, so Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org