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.

> +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().

> +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.

Attachment: signature.asc
Description: PGP signature

Reply via email to