Skip to contentSkip to conversation

contrib/libvhost-user: add the protocol feature used for SET/GET message

PATCH In review Changpeng Liu 2 participants 4 messages Mar 30, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 contrib/libvhost-user: add the protocol feature used for SET/GET message

---
 contrib/libvhost-user/libvhost-user.h | 1 +
 1 file changed, 1 insertion(+)
contrib/libvhost-user/libvhost-user.h +1 -0
index 79f7a53..b27075e 100644
@@ -50,6 +50,7 @@ enum VhostUserProtocolFeature {
     VHOST_USER_PROTOCOL_F_CROSS_ENDIAN = 6,
     VHOST_USER_PROTOCOL_F_CRYPTO_SESSION = 7,
     VHOST_USER_PROTOCOL_F_PAGEFAULT = 8,
+    VHOST_USER_PROTOCOL_F_CONFIG = 9,
 
     VHOST_USER_PROTOCOL_F_MAX
 };
Signature · 1 line
1.9.3
#1 lore raw

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

This patch reports the protocol feature that is only advertised by QEMU if the device implements the config ops.

---
 contrib/vhost-user-blk/vhost-user-blk.c | 7 +++++++
 1 file changed, 7 insertions(+)
contrib/vhost-user-blk/vhost-user-blk.c +7 -0
index 67dac81..f6e0170 100644
@@ -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,
Signature · 1 line
1.9.3
#2 lore raw

Re: [Qemu-devel] [PATCH 2/2] contrib/vhost-user-blk: enable protocol feature for vhost-user-blk

Quoted 4 lines · Changpeng Liu

This patch reports the protocol feature that is only advertised by QEMU if the device implements the config ops.

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.

Quoted 31 lines
---
 contrib/vhost-user-blk/vhost-user-blk.c | 7 +++++++
 1 file changed, 7 insertions(+)
contrib/vhost-user-blk/vhost-user-blk.c +7 -0
index 67dac81..f6e0170 100644
@@ -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,
Signature · 1 line
1.9.3
#3 lore raw
In reply to Changpeng Liu

The patch serials depend on Maxime's patch "vhost-user: back SET/GET_CONFIG requests with a protocol feature", which adding the protocol feature bit for SET/GET messages.

Quoted 29 lines

-----Original Message-----
From: Liu, Changpeng
Sent: Friday, March 30, 2018 10:46 AM
To: Liu, Changpeng <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: [PATCH 1/2] contrib/libvhost-user: add the protocol feature used for SET/GET message

---
 contrib/libvhost-user/libvhost-user.h | 1 +
 1 file changed, 1 insertion(+)
contrib/libvhost-user/libvhost- renamed from contrib/libvhost-user/libvhost-user.h +0 -0

user.h
index 79f7a53..b27075e 100644

contrib/libvhost-user/libvhost-user.h +1 -1
@@ -50,6 +50,7 @@ enum VhostUserProtocolFeature {
     VHOST_USER_PROTOCOL_F_CROSS_ENDIAN = 6,
     VHOST_USER_PROTOCOL_F_CRYPTO_SESSION = 7,
     VHOST_USER_PROTOCOL_F_PAGEFAULT = 8,
+    VHOST_USER_PROTOCOL_F_CONFIG = 9,
 
     VHOST_USER_PROTOCOL_F_MAX
 };
--

1.9.3