[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v6 04/20] virtio: add feature checking helpe
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH RFC v6 04/20] virtio: add feature checking helpers |
Date: |
Fri, 12 Dec 2014 09:37:36 +0100 |
On Thu, 11 Dec 2014 19:05:26 +0200
"Michael S. Tsirkin" <address@hidden> wrote:
> On Thu, Dec 11, 2014 at 03:46:23PM +0100, Thomas Huth wrote:
> > On Thu, 11 Dec 2014 14:25:06 +0100
> > Cornelia Huck <address@hidden> wrote:
> >
> > > Add a helper function for checking whether a bit is set in the guest
> > > features for a vdev as well as one that works on a feature bit set.
> > >
> > > Convert code that open-coded this: It cleans up the code and makes it
> > > easier to extend the guest feature bits.
> > >
> > > Signed-off-by: Cornelia Huck <address@hidden>
> > ...
> > > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
> > > index ef48550..56c92fb 100644
> > > --- a/hw/scsi/virtio-scsi.c
> > > +++ b/hw/scsi/virtio-scsi.c
> > > @@ -144,7 +144,7 @@ static int virtio_scsi_parse_req(VirtIOSCSIReq *req,
> > > *
> > > * TODO: always disable this workaround for virtio 1.0 devices.
> > > */
> > > - if ((vdev->guest_features & VIRTIO_F_ANY_LAYOUT) == 0) {
> > > + if (!virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT)) {
> >
> > Wait ... this does not only look like a clean-up, but also like a
> > bug-fix to me, since it should have been "(1 << VIRTIO_F_ANY_LAYOUT)"
> > instead of "VIRTIO_F_ANY_LAYOUT" in the original code instead?
I've clearly been looking at this stuff for too long, as I didn't even
notice this bug :)
> >
> > So in case this patch queue takes a little bit longer 'til it gets
> > upstream, do we might want to submit a separate patch for fixing this
> > issue first?
>
> Yes, please do.
OK, will send.
- [Qemu-devel] [PATCH RFC v6 00/20] qemu: towards virtio-1 host support, Cornelia Huck, 2014/12/11
- [Qemu-devel] [PATCH RFC v6 02/20] virtio: cull virtio_bus_set_vdev_features, Cornelia Huck, 2014/12/11
- [Qemu-devel] [PATCH RFC v6 03/20] virtio: feature bit manipulation helpers, Cornelia Huck, 2014/12/11
- [Qemu-devel] [PATCH RFC v6 06/20] virtio: endianness checks for virtio 1.0 devices, Cornelia Huck, 2014/12/11
- [Qemu-devel] [PATCH RFC v6 05/20] virtio: support more feature bits, Cornelia Huck, 2014/12/11
- [Qemu-devel] [PATCH RFC v6 08/20] dataplane: allow virtio-1 devices, Cornelia Huck, 2014/12/11
- [Qemu-devel] [PATCH RFC v6 10/20] s390x/virtio-ccw: add virtio set-revision call, Cornelia Huck, 2014/12/11