From: Paolo Bonzini <pbonzini@redhat.com>
To: Nathan Whitehorn <nwhitehorn@freebsd.org>
Cc: qemu-ppc <qemu-ppc@nongnu.org>, Alexander Graf <agraf@suse.de>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr_vscsi: Fix REPORT_LUNS handling
Date: Fri, 03 Jan 2014 14:27:52 +0100 [thread overview]
Message-ID: <52C6BAD8.3000107@redhat.com> (raw)
In-Reply-To: <52C5AEB0.5090505@freebsd.org>
Il 02/01/2014 19:23, Nathan Whitehorn ha scritto:
>>> Let me try to grasp what you're doing here. You're trying to
>>> figure out how many devices there are attached to the bus. For
>>> every device you reserve a buffer block. Lun0 is mandatory, all
>>> others are optional.
>>>
>>> First off, I think the code would be easier to grasp if you'd
>>> count "number of entries" rather than "number of bytes". That way
>>> we don't have to mentally deal with the 8 byte block
>>> granularity.
>>>
>>> Then IIUC you're jumping through a lot of hoops to count lun0 if
>>> it's there, but keep it reserved when it's not there. Why don't
>>> you just always reserve entry 0 for lun0? In the loop where
>>> you're actually filling in data you just skip lun0. Or is lun0 a
>>> terminator and always has to come last?
This is simply because you should not report lun 0 twice; even if it is
not defined, LUN 0 is there as a dummy device that only answers a
handful of commands (including INQUIRY and REPORT LUNS). There are many
ways to write it, but unless you use GArray or something like that, it
will look very much like Nathan and hw/scsi/scsi-bus.c's code.
Paolo
next prev parent reply other threads:[~2014-01-03 13:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-18 12:33 [Qemu-devel] [PATCH] spapr_vscsi: Fix REPORT_LUNS handling Nathan Whitehorn
2013-12-02 17:51 ` Nathan Whitehorn
2013-12-02 17:58 ` Paolo Bonzini
2014-01-02 15:05 ` Nathan Whitehorn
2014-01-02 15:31 ` Alexander Graf
2014-01-02 15:41 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-01-02 15:56 ` ronnie sahlberg
2014-01-02 18:14 ` Nathan Whitehorn
2014-01-02 21:44 ` Paolo Bonzini
2014-01-02 18:23 ` Nathan Whitehorn
2014-01-03 13:27 ` Paolo Bonzini [this message]
2014-01-12 22:35 ` Nathan Whitehorn
2014-01-02 18:28 ` [Qemu-devel] " Nathan Whitehorn
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=52C6BAD8.3000107@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@suse.de \
--cc=nwhitehorn@freebsd.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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;
as well as URLs for NNTP newsgroup(s).