[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 08/13] libvhost-user: expose vu_request_to_string
From: |
Alex Bennée |
Subject: |
[PATCH v1 08/13] libvhost-user: expose vu_request_to_string |
Date: |
Mon, 21 Mar 2022 15:30:32 +0000 |
This is useful for more human readable debug messages in vhost-user
programs.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
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 47d2efc60f..c218f911e7 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
--
2.30.2
- [PATCH v1 00/13] various virtio docs, fixes and tweaks, Alex Bennée, 2022/03/21
- [PATCH v1 02/13] virtio-pci: add notification trace points, Alex Bennée, 2022/03/21
- [PATCH v1 01/13] hw/virtio: move virtio-pci.h into shared include space, Alex Bennée, 2022/03/21
- [PATCH v1 03/13] hw/virtio: add vhost_user_[read|write] trace points, Alex Bennée, 2022/03/21
- [PATCH v1 04/13] docs: vhost-user: clean up request/reply description, Alex Bennée, 2022/03/21
- [PATCH v1 06/13] docs: vhost-user: replace master/slave with front-end/back-end, Alex Bennée, 2022/03/21
- [PATCH v1 08/13] libvhost-user: expose vu_request_to_string,
Alex Bennée <=
- [PATCH v1 10/13] include/hw: start documenting the vhost API, Alex Bennée, 2022/03/21
- [PATCH v1 07/13] vhost-user.rst: add clarifying language about protocol negotiation, Alex Bennée, 2022/03/21
- [PATCH v1 09/13] docs/devel: start documenting writing VirtIO devices, Alex Bennée, 2022/03/21
- [PATCH v1 11/13] contrib/vhost-user-blk: fix 32 bit build and enable, Alex Bennée, 2022/03/21
- [PATCH v1 12/13] hw/virtio/vhost-user: don't suppress F_CONFIG when supported, Alex Bennée, 2022/03/21