On 02/24/2012 08:54 AM, Hu Tao wrote: > diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c > index 380073a..1f3b851 100644 > --- a/hw/virtio-scsi.c > +++ b/hw/virtio-scsi.c > @@ -239,7 +239,7 @@ static VirtIOSCSIReq *virtio_scsi_pop_req(VirtIOSCSI *s, > VirtQueue *vq) > > static void virtio_scsi_do_tmf(VirtIOSCSI *s, VirtIOSCSIReq *req) > { > - SCSIDevice *d = virtio_scsi_device_find(s, req->req.cmd->lun); > + SCSIDevice *d = virtio_scsi_device_find(s, req->req.tmf->lun); > SCSIRequest *r, *next; > DeviceState *qdev; > int target; > @@ -253,11 +253,11 @@ static void virtio_scsi_do_tmf(VirtIOSCSI *s, > VirtIOSCSIReq *req) > if (!d) { > goto fail; > } > - if (d->lun != virtio_scsi_get_lun(req->req.cmd->lun)) { > + if (d->lun != virtio_scsi_get_lun(req->req.tmf->lun)) { > goto incorrect_lun; > } > QTAILQ_FOREACH_SAFE(r, &d->requests, next, next) { > - if (r->tag == req->req.cmd->tag) { > + if (r->tag == req->req.tmf->tag) { > break; > } > } > @@ -277,7 +277,7 @@ static void virtio_scsi_do_tmf(VirtIOSCSI *s, > VirtIOSCSIReq *req) > if (!d) { > goto fail; > } > - if (d->lun != virtio_scsi_get_lun(req->req.cmd->lun)) { > + if (d->lun != virtio_scsi_get_lun(req->req.tmf->lun)) { > goto incorrect_lun; > } > s->resetting++; > @@ -291,7 +291,7 @@ static void virtio_scsi_do_tmf(VirtIOSCSI *s, > VirtIOSCSIReq *req) > if (!d) { > goto fail; > } > - if (d->lun != virtio_scsi_get_lun(req->req.cmd->lun)) { > + if (d->lun != virtio_scsi_get_lun(req->req.tmf->lun)) { > goto incorrect_lun; > } > QTAILQ_FOREACH_SAFE(r, &d->requests, next, next) { > @@ -310,7 +310,7 @@ static void virtio_scsi_do_tmf(VirtIOSCSI *s, > VirtIOSCSIReq *req) > break; > > case VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: > - target = req->req.cmd->lun[1]; > + target = req->req.tmf->lun[1]; > s->resetting++; > QTAILQ_FOREACH(qdev, &s->bus.qbus.children, sibling) { > d = DO_UPCAST(SCSIDevice, qdev, qdev);
This is now fixed on github. Paolo