[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 65/91] libvhost-user: expose vu_request_to_string
From: |
Michael S. Tsirkin |
Subject: |
[PULL 65/91] libvhost-user: expose vu_request_to_string |
Date: |
Mon, 16 May 2022 06:39:22 -0400 |
From: Alex Bennée <alex.bennee@linaro.org>
This is useful for more human readable debug messages in vhost-user
programs.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220321153037.3622127-9-alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
subprojects/libvhost-user/libvhost-user.h | 9 +++++++++
subprojects/libvhost-user/libvhost-user.c | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/subprojects/libvhost-user/libvhost-user.h
b/subprojects/libvhost-user/libvhost-user.h
index cde9f07bb3..aea7ec5061 100644
--- a/subprojects/libvhost-user/libvhost-user.h
+++ b/subprojects/libvhost-user/libvhost-user.h
@@ -473,6 +473,15 @@ bool vu_init(VuDev *dev,
*/
void vu_deinit(VuDev *dev);
+
+/**
+ * vu_request_to_string: return string for vhost message request
+ * @req: VhostUserMsg request
+ *
+ * Returns a const string, do not free.
+ */
+const char *vu_request_to_string(unsigned int req);
+
/**
* vu_dispatch:
* @dev: a VuDev context
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index d0041c864b..b4cc3c2d68 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -99,7 +99,7 @@ static inline bool vu_has_protocol_feature(VuDev *dev,
unsigned int fbit)
return has_feature(dev->protocol_features, fbit);
}
-static const char *
+const char *
vu_request_to_string(unsigned int req)
{
#define REQ(req) [req] = #req
--
MST
- [PULL 55/91] intel-iommu: update root_scalable before switching as during post_load, (continued)
- [PULL 55/91] intel-iommu: update root_scalable before switching as during post_load, Michael S. Tsirkin, 2022/05/16
- [PULL 56/91] intel-iommu: update iq_dw during post load, Michael S. Tsirkin, 2022/05/16
- [PULL 57/91] vhost_net: Print feature masks in hex, Michael S. Tsirkin, 2022/05/16
- [PULL 60/91] hw/virtio: add vhost_user_[read|write] trace points, Michael S. Tsirkin, 2022/05/16
- [PULL 58/91] hw/virtio: move virtio-pci.h into shared include space, Michael S. Tsirkin, 2022/05/16
- [PULL 62/91] docs: vhost-user: rewrite section on ring state machine, Michael S. Tsirkin, 2022/05/16
- [PULL 63/91] docs: vhost-user: replace master/slave with front-end/back-end, Michael S. Tsirkin, 2022/05/16
- [PULL 59/91] virtio-pci: add notification trace points, Michael S. Tsirkin, 2022/05/16
- [PULL 61/91] docs: vhost-user: clean up request/reply description, Michael S. Tsirkin, 2022/05/16
- [PULL 64/91] vhost-user.rst: add clarifying language about protocol negotiation, Michael S. Tsirkin, 2022/05/16
- [PULL 65/91] libvhost-user: expose vu_request_to_string,
Michael S. Tsirkin <=
- [PULL 66/91] docs/devel: start documenting writing VirtIO devices, Michael S. Tsirkin, 2022/05/16
- [PULL 67/91] include/hw: start documenting the vhost API, Michael S. Tsirkin, 2022/05/16
- [PULL 68/91] hw/virtio/vhost-user: don't suppress F_CONFIG when supported, Michael S. Tsirkin, 2022/05/16
- [PULL 69/91] virtio/vhost-user: dynamically assign VhostUserHostNotifiers, Michael S. Tsirkin, 2022/05/16
- [PULL 70/91] virtio: drop name parameter for virtio_init(), Michael S. Tsirkin, 2022/05/16
- [PULL 71/91] virtio: add vhost support for virtio devices, Michael S. Tsirkin, 2022/05/16
- [PULL 72/91] qmp: add QMP command x-query-virtio, Michael S. Tsirkin, 2022/05/16
- [PULL 73/91] qmp: add QMP command x-query-virtio-status, Michael S. Tsirkin, 2022/05/16
- [PULL 75/91] qmp: add QMP commands for virtio/vhost queue-status, Michael S. Tsirkin, 2022/05/16
- [PULL 74/91] qmp: decode feature & status bits in virtio-status, Michael S. Tsirkin, 2022/05/16