qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] scsi-disk: Implement 'REPORT TARGET PORT GR


From: Hannes Reinecke
Subject: Re: [Qemu-devel] [PATCH 3/3] scsi-disk: Implement 'REPORT TARGET PORT GROUPS'
Date: Wed, 25 Nov 2015 09:55:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

-----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
address@hidden                                 +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 via email to

[Prev in Thread] Current Thread [Next in Thread]