qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>, qemu-devel@nongnu.org
Cc: Lu Lina <lina.lulina@huawei.com>
Subject: Re: [Qemu-devel] [PATCH] vhost-scsi: Fix mask index err in vhost_scsi_start
Date: Mon, 27 Jul 2015 13:35:57 +0200	[thread overview]
Message-ID: <55B6179D.8030108@redhat.com> (raw)
In-Reply-To: <55B611FA.4000203@huawei.com>



On 27/07/2015 13:11, Gonglei wrote:
> On 2015/7/27 18:20, Paolo Bonzini wrote:
>>
>>
>> On 27/07/2015 08:25, arei.gonglei@huawei.com wrote:
>>> +++ b/hw/scsi/vhost-scsi.c
>>> @@ -117,7 +117,7 @@ static int vhost_scsi_start(VHostSCSI *s)
>>>       * enabling/disabling irqfd.
>>>       */
>>>      for (i = 0; i < s->dev.nvqs; i++) {
>>> -        vhost_virtqueue_mask(&s->dev, vdev, i, false);
>>> +        vhost_virtqueue_mask(&s->dev, vdev, s->dev.vq_index + i, false);
>>>      }
>>>  
>>>      return ret;
>>
>> Is this fixing an actual bug, or just using the API correctly?
>> s->dev.vq_index is always 0, right?
>>
> Yes.  At present, we found that s->dev.vq_index is always 0.

Ok, then I've applied the patch with this commit message:

vhost_virtqueue_mask takes an "absolute" virtqueue index, while the
code looks like it's passing an index that is relative to
s->dev.vq_index.  In reality, s->dev.vq_index is always zero, so
this patch does not make any difference, but the code is clearer.

Paolo

  reply	other threads:[~2015-07-27 11:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27  6:25 [Qemu-devel] [PATCH] vhost-scsi: Fix mask index err in vhost_scsi_start arei.gonglei
2015-07-27 10:20 ` Paolo Bonzini
2015-07-27 11:11   ` Gonglei
2015-07-27 11:35     ` Paolo Bonzini [this message]
2015-07-27 11:41       ` Gonglei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55B6179D.8030108@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=lina.lulina@huawei.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).