qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Coiby Xu <coiby.xu@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: kwolf@redhat.com,
	"open list:Block layer core" <qemu-block@nongnu.org>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	bharatlkmlkvm@gmail.com, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v8 3/4] vhost-user block device backend server
Date: Mon, 15 Jun 2020 03:04:24 +0800	[thread overview]
Message-ID: <20200614190424.4mabhchxaqtqmo6v@r> (raw)
In-Reply-To: <20200611152452.GC77457@stefanha-x1.localdomain>

On Thu, Jun 11, 2020 at 04:24:52PM +0100, Stefan Hajnoczi wrote:
>On Fri, Jun 05, 2020 at 07:35:37AM +0800, Coiby Xu wrote:
>> +static void coroutine_fn vu_block_virtio_process_req(void *opaque)
>> +{
>> +    struct req_data *data = opaque;
>> +    VuServer *server = data->server;
>> +    VuVirtq *vq = data->vq;
>> +    VuVirtqElement *elem = data->elem;
>> +    uint32_t type;
>> +    VuBlockReq *req;
>> +
>> +    VuBlockDev *vdev_blk = get_vu_block_device_by_server(server);
>> +    BlockBackend *backend = vdev_blk->backend;
>> +
>> +    struct iovec *in_iov = elem->in_sg;
>> +    struct iovec *out_iov = elem->out_sg;
>> +    unsigned in_num = elem->in_num;
>> +    unsigned out_num = elem->out_num;
>> +    /* refer to hw/block/virtio_blk.c */
>> +    if (elem->out_num < 1 || elem->in_num < 1) {
>> +        error_report("virtio-blk request missing headers");
>> +        free(elem);
>> +        return;
>> +    }
>> +
>> +    req = g_new0(VuBlockReq, 1);
>
>elem was allocated with enough space for VuBlockReq. Can this allocation
>be eliminated?
>
>  typedef struct VuBlockReq {
>-     VuVirtqElement *elem;
>+     VuVirtqElement elem;
>      int64_t sector_num;
>      size_t size;
>      struct virtio_blk_inhdr *in;
>      struct virtio_blk_outhdr out;
>      VuServer *server;
>      struct VuVirtq *vq;
>  } VuBlockReq;

Thank you for review this patch. Other issues for this patch have been
addressed in v9 except for this one. I'm not sure what you mean. I can't
find a way that doesn't require to allocate a VuBlockReq struct.


--
Best regards,
Coiby


  reply	other threads:[~2020-06-14 19:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 23:35 [PATCH v8 0/4] vhost-user block device backend implementation Coiby Xu
2020-06-04 23:35 ` [PATCH v8 1/4] Allow vu_message_read to be replaced Coiby Xu
2020-06-11 10:45   ` Stefan Hajnoczi
2020-06-11 11:26   ` Marc-André Lureau
2020-06-04 23:35 ` [PATCH v8 2/4] generic vhost user server Coiby Xu
2020-06-11 13:14   ` Stefan Hajnoczi
2020-06-14 18:43     ` Coiby Xu
2020-06-04 23:35 ` [PATCH v8 3/4] vhost-user block device backend server Coiby Xu
2020-06-11 15:24   ` Stefan Hajnoczi
2020-06-14 19:04     ` Coiby Xu [this message]
2020-06-04 23:35 ` [PATCH v8 4/4] new qTest case to test the vhost-user-blk-server Coiby Xu
2020-06-05  5:01   ` Thomas Huth
2020-06-05  6:22     ` Coiby Xu
2020-06-05  9:25       ` Thomas Huth
2020-06-05 13:27         ` Coiby Xu
2020-06-11 12:37 ` [PATCH v8 0/4] vhost-user block device backend implementation Stefano Garzarella
2020-06-14 18:46   ` Coiby Xu
2020-06-15  8:46     ` Stefano Garzarella
2020-06-16  6:55       ` Coiby Xu
2020-06-11 15:27 ` Stefan Hajnoczi
2020-06-12 15:58   ` Coiby Xu

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=20200614190424.4mabhchxaqtqmo6v@r \
    --to=coiby.xu@gmail.com \
    --cc=bharatlkmlkvm@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).