Received: from eggs.gnu.org ([2001:4830:134:3::10]:53734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLAjW-0001wO-BG for qemu-devel@nongnu.org; Thu, 07 Jul 2016 10:56:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLAjU-0000Tq-Ek for qemu-devel@nongnu.org; Thu, 07 Jul 2016 10:56:53 -0400 References: <1467732272-23368-1-git-send-email-clord@redhat.com> <1467732272-23368-18-git-send-email-clord@redhat.com> <82a46074-ea26-dcae-bc03-bdeab432736a@redhat.com> From: Colin Lord Message-ID: <14de0a9c-f28f-ed3f-ffaa-83bc4725ec72@redhat.com> Date: Thu, 7 Jul 2016 10:56:45 -0400 MIME-Version: 1.0 In-Reply-To: <82a46074-ea26-dcae-bc03-bdeab432736a@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 17/32] blockdev: Separate bochs probe from its driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org On 07/06/2016 11:59 AM, Max Reitz wrote: > On 05.07.2016 17:24, Colin Lord wrote: >> Modifies the bochs probe to return the format name as well as the >> score as the final step of separating the probe function from the >> driver. This keeps the probe completely independent of the driver, >> making future modularization easier to accomplish. Returning the format >> name as well as the score allows the score to be correlated to the >> driver without the probe function needing to be part of the driver. >> >> Signed-off-by: Colin Lord >> --- >> block.c | 19 +++++++++++++++++++ >> block/bochs.c | 1 - >> block/probe/bochs.c | 25 ++++++++++++++++--------- >> include/block/probe.h | 3 ++- >> 4 files changed, 37 insertions(+), 11 deletions(-) > > Oh, and another comment: I think it would be better to split this patch > into a part that modifies block.c (introducing the format_probes array > and using it in bdrv_probe_all()) and another one that actually does the > bochs-specific stuff. > > Max > I could do that, but if I leave the variable i as an unsigned type, I get compiler warnings/errors that the for loop condition of i < ARRAY_SIZE(format_probes) must be false since the size of format_probes will be 0 (and unsigned is always positive). Is it okay to change the type to int? Not sure how strictly this aspect of the coding style gets enforced. Colin