libvhost-user: expose vu_request_to_string

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>
master
Alex Bennée 11 months ago committed by Michael S. Tsirkin
parent fa9972662c
commit 467eeb0f80
  1. 2
      subprojects/libvhost-user/libvhost-user.c
  2. 9
      subprojects/libvhost-user/libvhost-user.h

@ -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

@ -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

Loading…
Cancel
Save