libvhost-user: expose vu_request_to_string
authorAlex Bennée <alex.bennee@linaro.org>
Mon, 21 Mar 2022 15:30:32 +0000 (15:30 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 16 May 2022 08:38:40 +0000 (04:38 -0400)
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.c
subprojects/libvhost-user/libvhost-user.h

index d0041c864b75e159b3fa1a94a329d6ad6aa21179..b4cc3c2d68002a61b3e54764ee3e47683f30b3d4 100644 (file)
@@ -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
index cde9f07bb3c4a12495b9a3caaafc69a54d742e23..aea7ec5061d5f72128ea75ae8ad7bce7dc8ef22d 100644 (file)
@@ -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