qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pan Nengyuan <pannengyuan@huawei.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: kwolf@redhat.com, zhang.zhanghailiang@huawei.com,
	qemu-block@nongnu.org, mst@redhat.com, qemu-devel@nongnu.org,
	mreitz@redhat.com
Subject: Re: [PATCH 2/2] vhost-use-blk: convert to new virtio_delete_queue
Date: Sat, 22 Feb 2020 15:56:49 +0800	[thread overview]
Message-ID: <be4bd36a-9ada-bc66-007a-9583d5b04108@huawei.com> (raw)
In-Reply-To: <20200221113118.GG1484511@stefanha-x1.localdomain>



On 2/21/2020 7:31 PM, Stefan Hajnoczi wrote:
> On Thu, Feb 13, 2020 at 09:28:07AM +0800, pannengyuan@huawei.com wrote:
>> diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
>> index 2eba8b9db0..ed6a5cc03b 100644
>> --- a/hw/block/vhost-user-blk.c
>> +++ b/hw/block/vhost-user-blk.c
>> @@ -420,9 +420,10 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp)
>>      virtio_init(vdev, "virtio-blk", VIRTIO_ID_BLOCK,
>>                  sizeof(struct virtio_blk_config));
>>  
>> +    s->virtqs = g_new0(VirtQueue *, s->num_queues);
> 
> Minor point, up to you if you want to change it: the array is fully
> initialized by the for loop in the next line.  There is no need to clear
> the memory first:
> 
> s/g_new0/g_new/
OK, it's fine, I will change it.

Thanks.

> 
>> diff --git a/include/hw/virtio/vhost-user-blk.h b/include/hw/virtio/vhost-user-blk.h
>> index 108bfadeeb..f68911f6f0 100644
>> --- a/include/hw/virtio/vhost-user-blk.h
>> +++ b/include/hw/virtio/vhost-user-blk.h
>> @@ -37,6 +37,7 @@ typedef struct VHostUserBlk {
>>      struct vhost_inflight *inflight;
>>      VhostUserState vhost_user;
>>      struct vhost_virtqueue *vqs;
>> +    VirtQueue **virtqs;
> 
> Both vqs and virtqs exist and are easily confused.  Please rename vqs to
> vhost_vqs.

OK, I will do it.

Thanks.

> 


  reply	other threads:[~2020-02-22  7:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13  1:28 [PATCH 0/2] delete virtio queues in vhost-user-blk-unrealize pannengyuan
2020-02-13  1:28 ` [PATCH 1/2] vhost-user-blk: delete virtioqueues in unrealize to fix memleaks pannengyuan
2020-02-21 11:32   ` Stefan Hajnoczi
2020-02-13  1:28 ` [PATCH 2/2] vhost-use-blk: convert to new virtio_delete_queue pannengyuan
2020-02-21 11:31   ` Stefan Hajnoczi
2020-02-22  7:56     ` Pan Nengyuan [this message]
2020-02-25 13:31   ` Michael S. Tsirkin

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=be4bd36a-9ada-bc66-007a-9583d5b04108@huawei.com \
    --to=pannengyuan@huawei.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /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).