From: Markus Armbruster <armbru@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Hannes Reinecke <hare@suse.de>,
kvm@vger.kernel.org, Alexander Graf <agraf@suse.de>
Subject: Re: [PATCH 6/6] scsi-disk: Check for supported commands
Date: Wed, 27 Jul 2011 08:15:14 +0200 [thread overview]
Message-ID: <m3fwlsz1u5.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <20110726132031.GA3387@lst.de> (Christoph Hellwig's message of "Tue, 26 Jul 2011 15:20:31 +0200")
Christoph Hellwig <hch@lst.de> writes:
> 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 <hare@suse.de>
>
> 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.
It fits into what we have...
> 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.
Commit b443ae67 `scsi: Split qdev "scsi-disk" into "scsi-hd" and
"scsi-cd"' was a first baby step towards that goal.
Munging everything together may look like an easy way to avoid code
duplication initially, but leads to "common" code riddled with special
cases.
Proper code reuse among the separate drivers will have to be enforced.
Anyway, back to the patch's topic: ideas on how to reject SCSI commands
invalid for the device type given the current state of affairs,
i.e. disks and CD-ROMs munged together in scsi-disk.c? "Don't, change
state of affairs first" is a valid answer, it just means we probably
won't get them rejected any time soon.
next prev parent reply other threads:[~2011-07-27 6:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 14:51 [PATCH 0/6][v2] Check for supported SCSI commands Hannes Reinecke
2011-07-22 14:51 ` [PATCH 1/6] scsi-disk: Codingstyle fixes Hannes Reinecke
2011-07-22 14:51 ` [PATCH 2/6] scsi: Remove references to SET_WINDOW Hannes Reinecke
2011-07-22 14:51 ` [PATCH 3/6] scsi: Remove REZERO_UNIT emulation Hannes Reinecke
2011-07-22 14:51 ` [PATCH 4/6] scsi: Sanitize command definitions Hannes Reinecke
2011-07-22 14:51 ` [PATCH 5/6] scsi-disk: Remove 'drive_kind' Hannes Reinecke
2011-07-25 15:59 ` [Qemu-devel] " Markus Armbruster
2011-07-26 6:21 ` Hannes Reinecke
2011-07-26 6:38 ` Markus Armbruster
2011-07-26 6:46 ` Hannes Reinecke
2011-07-22 14:51 ` [PATCH 6/6] scsi-disk: Check for supported commands Hannes Reinecke
2011-07-26 13:07 ` Kevin Wolf
2011-07-26 13:15 ` Hannes Reinecke
2011-07-26 13:20 ` [Qemu-devel] " Christoph Hellwig
2011-07-27 6:15 ` Markus Armbruster [this message]
2011-07-26 13:46 ` Kevin Wolf
2011-07-26 14:19 ` Hannes Reinecke
2011-07-25 16:04 ` [PATCH 0/6][v2] Check for supported SCSI commands Markus Armbruster
2011-07-26 6:18 ` [Qemu-devel] " Hannes Reinecke
2011-07-26 13:48 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3fwlsz1u5.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=agraf@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kvm@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox