[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2 WIP 0/2] vhost-scsi: new device supporting th
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH V2 WIP 0/2] vhost-scsi: new device supporting the tcm_vhost Linux kernel module |
Date: |
Thu, 14 Mar 2013 11:00:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3 |
>> --------------- 8 ---------------> seabios patch:
>> diff --git a/src/virtio-scsi.c b/src/virtio-scsi.c
>> index 879ddfb..4de1255 100644
>> --- a/src/virtio-scsi.c
>> +++ b/src/virtio-scsi.c
>> @@ -147,6 +147,9 @@ init_virtio_scsi(struct pci_device *pci)
>> goto fail;
>> }
>>
>> + vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE |
>> + VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_DRIVER_OK);
>> +
>> int i, tot;
>> for (tot = 0, i = 0; i < 256; i++)
>> tot += virtio_scsi_scan_target(pci, ioaddr, vq, i);
>> @@ -154,8 +157,6 @@ init_virtio_scsi(struct pci_device *pci)
>> if (!tot)
>> goto fail;
>>
>> - vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE |
>> - VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_DRIVER_OK);
>> return;
>>
>> fail:
ACK.
>> diff --git a/src/virtio-scsi.h b/src/virtio-scsi.h
>> index bbfbf30..96c3701 100644
>> --- a/src/virtio-scsi.h
>> +++ b/src/virtio-scsi.h
>> @@ -26,7 +26,7 @@ struct virtio_scsi_req_cmd {
>> u8 prio;
>> u8 crn;
>> char cdb[VIRTIO_SCSI_CDB_SIZE];
>> -};
>> +} __attribute__((packed));
>>
>> /* This is the first element of the "in" scatter-gather list. */
>> struct virtio_scsi_resp_cmd {
>> @@ -36,7 +36,7 @@ struct virtio_scsi_resp_cmd {
>> u8 status;
>> u8 response;
>> u8 sense[VIRTIO_SCSI_SENSE_SIZE];
>> -};
>> +} __attribute__((packed));
>>
>> #define VIRTIO_SCSI_S_OK 0
>
> I see, the padding creates the problem?
Looks like it does for req_cmd (which has length 51 and is padded to
56). QEMU incorrectly relies on the framing. Both of these are SeaBIOS
bugs, please do submit the patch.
Paolo