From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlhYs-0001hk-Ef for qemu-devel@nongnu.org; Tue, 26 Jul 2011 09:20:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlhYm-0006vq-L4 for qemu-devel@nongnu.org; Tue, 26 Jul 2011 09:20:38 -0400 Received: from verein.lst.de ([213.95.11.211]:48242 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlhYm-0006vj-GG for qemu-devel@nongnu.org; Tue, 26 Jul 2011 09:20:32 -0400 Date: Tue, 26 Jul 2011 15:20:31 +0200 From: Christoph Hellwig Message-ID: <20110726132031.GA3387@lst.de> References: <1311346277-32329-1-git-send-email-hare@suse.de> <1311346277-32329-7-git-send-email-hare@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1311346277-32329-7-git-send-email-hare@suse.de> Subject: Re: [Qemu-devel] [PATCH 6/6] scsi-disk: Check for supported commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hannes Reinecke Cc: Kevin Wolf , Alexander Graf , qemu-devel@nongnu.org, kvm@vger.kernel.org, Markus Armbruster On Fri, Jul 22, 2011 at 04:51:17PM +0200, Hannes Reinecke wrote: > Not every command is support for any device type. This patch adds > a check for rejecting unsupported commands. > > Signed-off-by: Hannes Reinecke This seems to conflic with Markus' series. But if we want to invest any major effort into it, we really need to different dispatch tables for different device types. There's two sane ways to do it: one top-level handler with a switch per device type, or tables with a handler pointer with a device type. I'm fine with either one. What I really don't get with this patch is the listing of all the different SCSI device types. It's already a mistake that we tried to handle disks and CDROMs with the same driver, but adding even more just makes it worth. IMHO we should simply have one file per SCSI spec, e.g. an spc.c for the common bits, then an sbc.c for disks, and mmc.c for cdroms. Maybe more the day we add more emulated device types.