diff options
author | John Levon <john.levon@nutanix.com> | 2020-11-19 09:23:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 09:23:10 +0000 |
commit | 58b89f9e0f7cd7847606fb22d2c0b9a38735cd62 (patch) | |
tree | 2fe5e0f56a1bb02572d8cd95cbd3c7f91a3ee9db /samples/client.c | |
parent | 57777a738b6945c203f28f7ee5829d04e8824f8c (diff) | |
download | libvfio-user-58b89f9e0f7cd7847606fb22d2c0b9a38735cd62.zip libvfio-user-58b89f9e0f7cd7847606fb22d2c0b9a38735cd62.tar.gz libvfio-user-58b89f9e0f7cd7847606fb22d2c0b9a38735cd62.tar.bz2 |
refactor socket code into lib/tran_sock.[ch] (#97)
Diffstat (limited to 'samples/client.c')
-rw-r--r-- | samples/client.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/samples/client.c b/samples/client.c index 1925f88..1c6f889 100644 --- a/samples/client.c +++ b/samples/client.c @@ -33,6 +33,7 @@ #include <sys/socket.h> #include <sys/un.h> #include <stdlib.h> +#include <stdarg.h> #include <errno.h> #include <sys/mman.h> #include <sys/eventfd.h> @@ -41,9 +42,27 @@ #include <assert.h> #include <sys/stat.h> -#include "../lib/muser.h" -#include "../lib/muser_priv.h" #include "../lib/common.h" +#include "../lib/muser.h" +#include "../lib/tran_sock.h" + +static char *irq_to_str[] = { + [LM_DEV_INTX_IRQ_IDX] = "INTx", + [LM_DEV_MSI_IRQ_IDX] = "MSI", + [LM_DEV_MSIX_IRQ_IDX] = "MSI-X", + [LM_DEV_ERR_IRQ_INDEX] = "ERR", + [LM_DEV_REQ_IRQ_INDEX] = "REQ" +}; + +void +lm_log(UNUSED lm_ctx_t *lm_ctx, UNUSED lm_log_lvl_t lvl, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); +} static int init_sock(const char *path) |