All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Johannes Thumshirn <jthumshirn@suse.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Alexander Graf <agraf@suse.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] scsi-disk: Implement 'REPORT TARGET PORT GROUPS'
Date: Wed, 25 Nov 2015 09:55:53 +0100	[thread overview]
Message-ID: <56557799.3030703@suse.de> (raw)
In-Reply-To: <20151125075557.GC7357@stefanha-x1.localdomain>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/25/2015 08:55 AM, Stefan Hajnoczi wrote:
> On Mon, Nov 16, 2015 at 03:36:58PM +0100, Hannes Reinecke
> wrote:
>> +    /* Enable TGPS bit */ +    if (s->wwn) +
>> outbuf[4] = 1;
> 
> QEMU coding style: Please always use curly braces, even if the
> if statement body is just one line.
> 
Yeah, will be doing so on the next round.

>> +static void qdev_enumerate_port_group(PortGroupEnumerate
>> *pg, DeviceState *dev) +{ +    BusState *child; + +    if
>> (!strcmp(object_get_typename(OBJECT(dev->parent_bus)),
>> TYPE_SCSI_BUS)) {
> 
> object_dynamic_cast(OBJECT(dev->parent_bus), TYPE_SCSI_BUS) is
> shorter and doesn't require the explicit strcmp().
> 
The ever-changing qemu infrastructure ... yeah, will be fixing it up.

>> +static int
>> scsi_emulate_report_target_port_groups(SCSIDiskState *s,
>> uint8_t *inbuf)
> 
> "inbuf" seems to be an output buffer rather than an input
> buffer.  The name "outbuf" would be clearer.
> 
> How does this function protect against buffer overflow?  It's
> not obvious how we guarantee the output buffer is large
> enough.
> 
Good question; will have to check.

Cheers,

Hannes
- -- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJWVXeZAAoJEGz4yi9OyKjP2yAQAIENfXolPp+Q6BsWyHEbinMn
P/Z+HlgEZE+fSP8qq4F4txzB/0FUpiuvonKTzJmC41izhXLGDs6vFPNH9CX7bNob
PmbWD7ZXVVJdEX8xpmJRNKN1XfIFcwHVE51FNqM62OggfMZx4XW3zZ9scpzEjaW0
70l1q7FEn+sg7BsE4aH11+fhdAdQaEo3G2tx8g6X2uleiNC0NJWIR7XyFJOl68wY
plmfotRgpX6x7vNKkge5EyMEBhpoltql8K6IsAJfWQlHIWduErGIXmCuaDdz1Whh
aLsfLNajG5CB7gZddu+XsIVlbujHqoTn26UTtPC8dL20w1S7wv/TaYnKLchRCn+5
UydjjI1AdB9EKqhQUGI6itGT+GDE/Rf3vDHzdUmZou4u/U3kuhWlupaCTGqLKpvA
HHOMi0EAqQrM30kYWX4jKhTSAP5Y8GKFQhBxVi7Y9pZSYWHIoMLg/LbKpFx97rN6
iSOkq9KYBJH+rgS5tBiHCTCYjrlbvHV5UiGVt2/Q0WjeRx0kMPLnLA1fGsiubnjs
ZjqpuIih72GTSSSzrvNPcpL4RmDWwXoh0UtamSs7jBMa/Gto8m0cHWxeaiJ3vxgC
E5EgxycmX81/smvq+kdre8XhECDYulyXffZxQWsZqsDChwFB+9OFL523bpZm1Pu4
+pqGLkHyVZPeQUCV1MWC
=b3kw
-----END PGP SIGNATURE-----

      reply	other threads:[~2015-11-25  8:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 14:36 [Qemu-devel] [PATCH 0/3] SCSI ALUA support Hannes Reinecke
2015-11-16 14:36 ` [Qemu-devel] [PATCH 1/3] scsi-disk: Add 'port_group' property Hannes Reinecke
2015-11-16 14:36 ` [Qemu-devel] [PATCH 2/3] scsi-disk: Add 'alua_state' property Hannes Reinecke
2015-11-16 14:36 ` [Qemu-devel] [PATCH 3/3] scsi-disk: Implement 'REPORT TARGET PORT GROUPS' Hannes Reinecke
2015-11-25  7:55   ` Stefan Hajnoczi
2015-11-25  8:55     ` Hannes Reinecke [this message]

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=56557799.3030703@suse.de \
    --to=hare@suse.de \
    --cc=agraf@suse.com \
    --cc=jthumshirn@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.