From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, stefanha@redhat.com, mst@redhat.com
Subject: [PATCH 6/7] libvhost-user: rename message names from "SLAVE" to "BACKEND"
Date: Thu, 11 Mar 2021 05:32:49 -0500 [thread overview]
Message-ID: <20210311103250.532191-7-pbonzini@redhat.com> (raw)
In-Reply-To: <20210311103250.532191-1-pbonzini@redhat.com>
Follow the terminology that is used in the specification. The old names
are preserved for API compatibility.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
subprojects/libvhost-user/libvhost-user.c | 20 ++++++------
subprojects/libvhost-user/libvhost-user.h | 39 ++++++++++++++++-------
2 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index fab7ca17ee..b7aef17e4e 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -125,7 +125,7 @@ vu_request_to_string(unsigned int req)
REQ(VHOST_USER_SET_VRING_ENABLE),
REQ(VHOST_USER_SEND_RARP),
REQ(VHOST_USER_NET_SET_MTU),
- REQ(VHOST_USER_SET_SLAVE_REQ_FD),
+ REQ(VHOST_USER_SET_BACKEND_REQ_FD),
REQ(VHOST_USER_IOTLB_MSG),
REQ(VHOST_USER_SET_VRING_ENDIAN),
REQ(VHOST_USER_GET_CONFIG),
@@ -1313,7 +1313,7 @@ bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *vq, int fd,
int qidx = vq - dev->vq;
int fd_num = 0;
VhostUserMsg vmsg = {
- .request = VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG,
+ .request = VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG,
.flags = VHOST_USER_VERSION | VHOST_USER_NEED_REPLY_MASK,
.size = sizeof(vmsg.payload.area),
.payload.area = {
@@ -1331,7 +1331,7 @@ bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *vq, int fd,
vmsg.fd_num = fd_num;
- if (!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)) {
+ if (!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD)) {
return false;
}
@@ -1409,9 +1409,9 @@ vu_get_protocol_features_exec(VuDev *dev, VhostUserMsg *vmsg)
*/
uint64_t features = 1ULL << VHOST_USER_PROTOCOL_F_MQ |
1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD |
- 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ |
+ 1ULL << VHOST_USER_PROTOCOL_F_BACKEND_REQ |
1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER |
- 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD |
+ 1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD |
1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK |
1ULL << VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS;
@@ -1442,7 +1442,7 @@ vu_set_protocol_features_exec(VuDev *dev, VhostUserMsg *vmsg)
if (vu_has_protocol_feature(dev,
VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS) &&
- (!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_SLAVE_REQ) ||
+ (!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_BACKEND_REQ) ||
!vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_REPLY_ACK))) {
/*
* The use case for using messages for kick/call is simulation, to make
@@ -1455,7 +1455,7 @@ vu_set_protocol_features_exec(VuDev *dev, VhostUserMsg *vmsg)
* that actually enables the simulation case.
*/
vu_panic(dev,
- "F_IN_BAND_NOTIFICATIONS requires F_SLAVE_REQ && F_REPLY_ACK");
+ "F_IN_BAND_NOTIFICATIONS requires F_BACKEND_REQ && F_REPLY_ACK");
return false;
}
@@ -1864,7 +1864,7 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg)
return vu_get_queue_num_exec(dev, vmsg);
case VHOST_USER_SET_VRING_ENABLE:
return vu_set_vring_enable_exec(dev, vmsg);
- case VHOST_USER_SET_SLAVE_REQ_FD:
+ case VHOST_USER_SET_BACKEND_REQ_FD:
return vu_set_slave_req_fd(dev, vmsg);
case VHOST_USER_GET_CONFIG:
return vu_get_config(dev, vmsg);
@@ -2370,9 +2370,9 @@ static void _vu_queue_notify(VuDev *dev, VuVirtq *vq, bool sync)
if (vq->call_fd < 0 &&
vu_has_protocol_feature(dev,
VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS) &&
- vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_SLAVE_REQ)) {
+ vu_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_BACKEND_REQ)) {
VhostUserMsg vmsg = {
- .request = VHOST_USER_SLAVE_VRING_CALL,
+ .request = VHOST_USER_BACKEND_VRING_CALL,
.flags = VHOST_USER_VERSION,
.size = sizeof(vmsg.payload.state),
.payload.state = {
diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost-user.h
index 3d13dfadde..eba3e1fc05 100644
--- a/subprojects/libvhost-user/libvhost-user.h
+++ b/subprojects/libvhost-user/libvhost-user.h
@@ -54,18 +54,20 @@ enum VhostUserProtocolFeature {
VHOST_USER_PROTOCOL_F_RARP = 2,
VHOST_USER_PROTOCOL_F_REPLY_ACK = 3,
VHOST_USER_PROTOCOL_F_NET_MTU = 4,
- VHOST_USER_PROTOCOL_F_SLAVE_REQ = 5,
+ VHOST_USER_PROTOCOL_F_BACKEND_REQ = 5,
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_SLAVE_SEND_FD = 10,
+ VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD = 10,
VHOST_USER_PROTOCOL_F_HOST_NOTIFIER = 11,
VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD = 12,
VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS = 14,
VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS = 15,
+ VHOST_USER_PROTOCOL_F_MAX,
- VHOST_USER_PROTOCOL_F_MAX
+ VHOST_USER_PROTOCOL_F_SLAVE_REQ = VHOST_USER_PROTOCOL_F_BACKEND_REQ,
+ VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD = VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD
};
#define VHOST_USER_PROTOCOL_FEATURE_MASK ((1 << VHOST_USER_PROTOCOL_F_MAX) - 1)
@@ -92,7 +94,7 @@ typedef enum VhostUserRequest {
VHOST_USER_SET_VRING_ENABLE = 18,
VHOST_USER_SEND_RARP = 19,
VHOST_USER_NET_SET_MTU = 20,
- VHOST_USER_SET_SLAVE_REQ_FD = 21,
+ VHOST_USER_SET_BACKEND_REQ_FD = 21,
VHOST_USER_IOTLB_MSG = 22,
VHOST_USER_SET_VRING_ENDIAN = 23,
VHOST_USER_GET_CONFIG = 24,
@@ -109,16 +111,29 @@ typedef enum VhostUserRequest {
VHOST_USER_GET_MAX_MEM_SLOTS = 36,
VHOST_USER_ADD_MEM_REG = 37,
VHOST_USER_REM_MEM_REG = 38,
- VHOST_USER_MAX
+ VHOST_USER_MAX,
+
+ VHOST_USER_SET_SLAVE_REQ_FD = VHOST_USER_SET_BACKEND_REQ_FD,
} VhostUserRequest;
+typedef enum VhostUserBackendRequest {
+ VHOST_USER_BACKEND_NONE = 0,
+ VHOST_USER_BACKEND_IOTLB_MSG = 1,
+ VHOST_USER_BACKEND_CONFIG_CHANGE_MSG = 2,
+ VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG = 3,
+ VHOST_USER_BACKEND_VRING_CALL = 4,
+ VHOST_USER_BACKEND_VRING_ERR = 5,
+ VHOST_USER_BACKEND_MAX
+} VhostUserBackendRequest;
+
+
typedef enum VhostUserSlaveRequest {
- VHOST_USER_SLAVE_NONE = 0,
- VHOST_USER_SLAVE_IOTLB_MSG = 1,
- VHOST_USER_SLAVE_CONFIG_CHANGE_MSG = 2,
- VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG = 3,
- VHOST_USER_SLAVE_VRING_CALL = 4,
- VHOST_USER_SLAVE_VRING_ERR = 5,
+ VHOST_USER_SLAVE_NONE = VHOST_USER_BACKEND_NONE,
+ VHOST_USER_SLAVE_IOTLB_MSG = VHOST_USER_BACKEND_IOTLB_MSG,
+ VHOST_USER_SLAVE_CONFIG_CHANGE_MSG = VHOST_USER_BACKEND_CONFIG_CHANGE_MSG,
+ VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG = VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG,
+ VHOST_USER_SLAVE_VRING_CALL = VHOST_USER_BACKEND_VRING_CALL,
+ VHOST_USER_SLAVE_VRING_ERR = VHOST_USER_BACKEND_VRING_ERR,
VHOST_USER_SLAVE_MAX
} VhostUserSlaveRequest;
@@ -295,7 +310,7 @@ typedef struct VuVirtqInflight {
uint16_t version;
/* The size of VuDescStateSplit array. It's equal to the virtqueue
- * size. Slave could get it from queue size field of VhostUserInflight. */
+ * size. The backend could get it from queue size field of VhostUserInflight. */
uint16_t desc_num;
/* The head of list that track the last batch of used descriptors. */
--
2.26.2
next prev parent reply other threads:[~2021-03-11 10:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 10:32 [PATCH v2 0/7] vhost: replace master/slave with more accurate wording Paolo Bonzini
2021-03-11 10:32 ` [PATCH 1/7] docs: vhost-user: clean up request/reply description Paolo Bonzini
2021-03-11 10:32 ` [PATCH 2/7] docs: vhost-user: rewrite section on ring state machine Paolo Bonzini
2021-03-11 10:32 ` [PATCH 3/7] docs: vhost-user: replace master/slave with frontend/backend Paolo Bonzini
2021-03-11 10:32 ` [PATCH 4/7] docs: vhost-user: rename message names from "SLAVE" to "BACKEND" Paolo Bonzini
2021-03-11 10:32 ` [PATCH 5/7] " Paolo Bonzini
2021-03-11 10:32 ` Paolo Bonzini [this message]
2021-03-11 10:32 ` [PATCH 7/7] libvhost-user: rename struct VuDev fields from "slave" to "backend" Paolo Bonzini
2021-03-11 10:45 ` [PATCH v2 0/7] vhost: replace master/slave with more accurate wording no-reply
2021-03-11 10:51 ` Marc-André Lureau
2021-03-11 11:08 ` Paolo Bonzini
2021-03-11 11:18 ` Marc-André Lureau
2021-03-11 11:27 ` Paolo Bonzini
2021-03-12 9:58 ` Stefano Garzarella
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=20210311103250.532191-7-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@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).