qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Coiby Xu <coiby.xu@gmail.com>
Cc: kwolf@redhat.com, bharatlkmlkvm@gmail.com, qemu-devel@nongnu.org,
	stefanha@redhat.com
Subject: Re: [PATCH v5 1/5] allow vu_message_read to be replaced
Date: Mon, 23 Mar 2020 14:50:05 +0000	[thread overview]
Message-ID: <20200323145005.GA313555@stefanha-x1.localdomain> (raw)
In-Reply-To: <20200309100342.14921-2-coiby.xu@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1538 bytes --]

On Mon, Mar 09, 2020 at 06:03:38PM +0800, Coiby Xu wrote:
> diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h
> index 6fc8000e99..7e3f0c8598 100644
> --- a/contrib/libvhost-user/libvhost-user.h
> +++ b/contrib/libvhost-user/libvhost-user.h
> @@ -30,6 +30,8 @@
> 
>  #define VHOST_MEMORY_MAX_NREGIONS 8
> 
> +#define VHOST_USER_HDR_SIZE offsetof(VhostUserMsg, payload.u64)
> +
>  typedef enum VhostSetConfigType {
>      VHOST_SET_CONFIG_TYPE_MASTER = 0,
>      VHOST_SET_CONFIG_TYPE_MIGRATION = 1,
> @@ -205,6 +207,7 @@ typedef uint64_t (*vu_get_features_cb) (VuDev *dev);
>  typedef void (*vu_set_features_cb) (VuDev *dev, uint64_t features);
>  typedef int (*vu_process_msg_cb) (VuDev *dev, VhostUserMsg *vmsg,
>                                    int *do_reply);
> +typedef bool (*vu_read_msg_cb) (VuDev *dev, int sock, VhostUserMsg *vmsg);
>  typedef void (*vu_queue_set_started_cb) (VuDev *dev, int qidx, bool started);
>  typedef bool (*vu_queue_is_processed_in_order_cb) (VuDev *dev, int qidx);
>  typedef int (*vu_get_config_cb) (VuDev *dev, uint8_t *config, uint32_t len);
> @@ -373,6 +376,8 @@ struct VuDev {
>      bool broken;
>      uint16_t max_queues;
> 
> +    /* allowing vu_read_msg_cb to be replaced */
> +    vu_read_msg_cb read_msg;

Please document this function pointer fully so it's clear how custom
implementations of this function should behave.  The return value should
be explained.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-03-23 14:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 10:03 [PATCH v5 0/5] vhost-user block device backend implementation Coiby Xu
2020-03-09 10:03 ` [PATCH v5 1/5] allow vu_message_read to be replaced Coiby Xu
2020-03-23 14:50   ` Stefan Hajnoczi [this message]
2020-03-09 10:03 ` [PATCH v5 2/5] generic vhost user server Coiby Xu
2020-03-23 16:04   ` Stefan Hajnoczi
2020-03-09 10:03 ` [PATCH v5 3/5] vhost-user block device backend server Coiby Xu
2020-03-09 10:03 ` [PATCH v5 4/5] a standone-alone tool to directly share disk image file via vhost-user protocol Coiby Xu
2020-03-09 10:03 ` [PATCH v5 5/5] new qTest case to test the vhost-user-blk-server Coiby Xu
2020-03-09 10:49 ` [PATCH v5 0/5] vhost-user block device backend implementation no-reply
2020-05-04 15:49 ` Stefan Hajnoczi

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=20200323145005.GA313555@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=bharatlkmlkvm@gmail.com \
    --cc=coiby.xu@gmail.com \
    --cc=kwolf@redhat.com \
    --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).