[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 04/16] virtio-scsi-test: add missing feature negotiation
From: |
Thomas Huth |
Subject: |
Re: [PATCH v3 04/16] virtio-scsi-test: add missing feature negotiation |
Date: |
Mon, 21 Oct 2019 14:08:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 19/10/2019 08.37, Stefan Hajnoczi wrote:
> VIRTIO Device Initialization requires feature negotiation. Currently
> virtio-scsi-test.c is non-compliant.
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> tests/virtio-scsi-test.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c
> index 7c8f9b27f8..0415e75876 100644
> --- a/tests/virtio-scsi-test.c
> +++ b/tests/virtio-scsi-test.c
> @@ -123,10 +123,16 @@ static QVirtioSCSIQueues
> *qvirtio_scsi_init(QVirtioDevice *dev)
> QVirtioSCSIQueues *vs;
> const uint8_t test_unit_ready_cdb[VIRTIO_SCSI_CDB_SIZE] = {};
> struct virtio_scsi_cmd_resp resp;
> + uint64_t features;
> int i;
>
> vs = g_new0(QVirtioSCSIQueues, 1);
> vs->dev = dev;
> +
> + features = qvirtio_get_features(dev);
> + features &= ~(QVIRTIO_F_BAD_FEATURE | (1ull << VIRTIO_RING_F_EVENT_IDX));
> + qvirtio_set_features(dev, features);
I wonder whether this get_feat + "&=" + set_feat is really the right way
here? Maybe we should rather only set the feature bits that we care
about instead of setting all but BAD_FEATURE and RING_F_EVENT_IDX?
Otherwise, please mention in the commit message why you've chosen to
disable just these two bits.
Thanks,
Thomas
- [PATCH v3 00/16] libqos: add VIRTIO PCI 1.0 support, Stefan Hajnoczi, 2019/10/19
- [PATCH v3 01/16] tests/virtio-blk-test: read config space after feature negotiation, Stefan Hajnoczi, 2019/10/19
- [PATCH v3 02/16] libqos: read QVIRTIO_MMIO_VERSION register, Stefan Hajnoczi, 2019/10/19
- [PATCH v3 03/16] libqos: extend feature bits to 64-bit, Stefan Hajnoczi, 2019/10/19
- [PATCH v3 04/16] virtio-scsi-test: add missing feature negotiation, Stefan Hajnoczi, 2019/10/19
- Re: [PATCH v3 04/16] virtio-scsi-test: add missing feature negotiation,
Thomas Huth <=
- [PATCH v3 05/16] tests/virtio-blk-test: set up virtqueue after feature negotiation, Stefan Hajnoczi, 2019/10/19
- [PATCH v3 06/16] libqos: add missing virtio-9p feature negotiation, Stefan Hajnoczi, 2019/10/19
- [PATCH v3 07/16] libqos: enforce Device Initialization order, Stefan Hajnoczi, 2019/10/19