diff mbox

[2/2] contrib/vhost-user-blk: enable protocol feature for vhost-user-blk

Message ID 1522377977-29623-2-git-send-email-changpeng.liu@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liu, Changpeng March 30, 2018, 2:46 a.m. UTC
This patch reports the protocol feature that is only advertised by
QEMU if the device implements the config ops.

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
---
 contrib/vhost-user-blk/vhost-user-blk.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Michael S. Tsirkin March 30, 2018, 3:13 a.m. UTC | #1
On Fri, Mar 30, 2018 at 10:46:17AM +0800, Changpeng Liu wrote:
> This patch reports the protocol feature that is only advertised by
> QEMU if the device implements the config ops.
> 
> Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>


OK but pls just send a single patch next time.
People often split out just the headers or some
utility functions with little value, but this
does not help review at all.

No need to repost just for this.

> ---
>  contrib/vhost-user-blk/vhost-user-blk.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
> index 67dac81..f6e0170 100644
> --- a/contrib/vhost-user-blk/vhost-user-blk.c
> +++ b/contrib/vhost-user-blk/vhost-user-blk.c
> @@ -311,6 +311,12 @@ vub_get_features(VuDev *dev)
>             1ull << VHOST_USER_F_PROTOCOL_FEATURES;
>  }
>  
> +static uint64_t
> +vub_get_protocol_features(VuDev *dev)
> +{
> +    return 1ull << VHOST_USER_PROTOCOL_F_CONFIG;
> +}
> +
>  static int
>  vub_get_config(VuDev *vu_dev, uint8_t *config, uint32_t len)
>  {
> @@ -372,6 +378,7 @@ vub_set_config(VuDev *vu_dev, const uint8_t *data,
>  
>  static const VuDevIface vub_iface = {
>      .get_features = vub_get_features,
> +    .get_protocol_features = vub_get_protocol_features,
>      .queue_set_started = vub_queue_set_started,
>      .get_config = vub_get_config,
>      .set_config = vub_set_config,
> -- 
> 1.9.3
diff mbox

Patch

diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
index 67dac81..f6e0170 100644
--- a/contrib/vhost-user-blk/vhost-user-blk.c
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
@@ -311,6 +311,12 @@  vub_get_features(VuDev *dev)
            1ull << VHOST_USER_F_PROTOCOL_FEATURES;
 }
 
+static uint64_t
+vub_get_protocol_features(VuDev *dev)
+{
+    return 1ull << VHOST_USER_PROTOCOL_F_CONFIG;
+}
+
 static int
 vub_get_config(VuDev *vu_dev, uint8_t *config, uint32_t len)
 {
@@ -372,6 +378,7 @@  vub_set_config(VuDev *vu_dev, const uint8_t *data,
 
 static const VuDevIface vub_iface = {
     .get_features = vub_get_features,
+    .get_protocol_features = vub_get_protocol_features,
     .queue_set_started = vub_queue_set_started,
     .get_config = vub_get_config,
     .set_config = vub_set_config,