aboutsummaryrefslogtreecommitdiff
path: root/samples/null.c
diff options
context:
space:
mode:
authorswapnili <swapnil.ingle@nutanix.com>2020-11-25 17:24:28 +0100
committerGitHub <noreply@github.com>2020-11-25 17:24:28 +0100
commitadc65938c8771172b80d6d523f7b1608ba3f8d46 (patch)
tree1b8eb890516c644e14eb4199cd6d1cb9f340755b /samples/null.c
parent7e48fee45f938bdb1f562155a9159e950eba4a5f (diff)
downloadlibvfio-user-adc65938c8771172b80d6d523f7b1608ba3f8d46.zip
libvfio-user-adc65938c8771172b80d6d523f7b1608ba3f8d46.tar.gz
libvfio-user-adc65938c8771172b80d6d523f7b1608ba3f8d46.tar.bz2
Split log setup from lm_create_ctx() to lm_setup_log() (#126)
* Split log setup from lm_create_ctx() to lm_setup_log() Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'samples/null.c')
-rw-r--r--samples/null.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/samples/null.c b/samples/null.c
index 5d52893..b633059 100644
--- a/samples/null.c
+++ b/samples/null.c
@@ -78,12 +78,16 @@ int main(int argc, char **argv)
errx(EXIT_FAILURE, "missing MUSER socket path");
}
- lm_ctx_t *lm_ctx = lm_create_ctx(LM_TRANS_SOCK, argv[1], 0, null_log,
- LM_DBG, NULL);
+ lm_ctx_t *lm_ctx = lm_create_ctx(LM_TRANS_SOCK, argv[1], 0, NULL);
if (lm_ctx == NULL) {
err(EXIT_FAILURE, "failed to create libmuser context");
}
+ ret = lm_setup_log(lm_ctx, null_log, LM_DBG);
+ if (ret < 0) {
+ err(EXIT_FAILURE, "failed to setup log");
+ }
+
ret = pthread_create(&thread, NULL, null_drive, lm_ctx);
if (ret != 0) {
errno = ret;