On (Wed) 22 Jun 2011 [09:53:35], Luiz Capitulino wrote: > On Wed, 22 Jun 2011 09:49:22 +0530 > Amit Shah <amit.s...@redhat.com> wrote:
> > > > > > - port = find_port_by_id(vser, ldl_p(&gcpkt->id)); > > > - if (!port && cpkt.event != VIRTIO_CONSOLE_DEVICE_READY) > > > - return; > > > - > > > - info = DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info); > > > - > > > - switch(cpkt.event) { > > > - case VIRTIO_CONSOLE_DEVICE_READY: > > > + if (cpkt.event == VIRTIO_CONSOLE_DEVICE_READY) { > > > > What we lose after this re-arrangement is the check that port is NULL > > when this message is received. i.e., a guest bug where port is set to > > a valid value when this message arrives. (I think I pointed this out > > in a previous mail?) > > I'm not sure I follow you here, the current code doesn't return if > cpkt.event == VIRTIO_CONSOLE_DEVICE_READY: > > port = find_port_by_id(vser, ldl_p(&gcpkt->id)); > if (!port && cpkt.event != VIRTIO_CONSOLE_DEVICE_READY) > return; Ah; right. Anyway it's a small thing, nothing to be worried about. Amit