diff options
author | swapnili <swapnil.ingle@nutanix.com> | 2020-11-25 17:24:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 17:24:28 +0100 |
commit | adc65938c8771172b80d6d523f7b1608ba3f8d46 (patch) | |
tree | 1b8eb890516c644e14eb4199cd6d1cb9f340755b /samples/gpio-pci-idio-16.c | |
parent | 7e48fee45f938bdb1f562155a9159e950eba4a5f (diff) | |
download | libvfio-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/gpio-pci-idio-16.c')
-rw-r--r-- | samples/gpio-pci-idio-16.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/samples/gpio-pci-idio-16.c b/samples/gpio-pci-idio-16.c index 419783f..6d1e6b8 100644 --- a/samples/gpio-pci-idio-16.c +++ b/samples/gpio-pci-idio-16.c @@ -99,8 +99,7 @@ main(int argc, char *argv[]) err(EXIT_FAILURE, "failed to register signal handler"); } - lm_ctx = lm_create_ctx(LM_TRANS_SOCK, argv[optind], 0, - verbose ? _log : NULL, LM_DBG, NULL); + lm_ctx = lm_create_ctx(LM_TRANS_SOCK, argv[optind], 0, NULL); if (lm_ctx == NULL) { if (errno == EINTR) { printf("interrupted\n"); @@ -109,6 +108,11 @@ main(int argc, char *argv[]) err(EXIT_FAILURE, "failed to initialize device emulation"); } + ret = lm_setup_log(lm_ctx, _log, verbose ? LM_DBG : LM_ERR); + if (ret < 0) { + err(EXIT_FAILURE, "failed to setup log"); + } + ret = lm_pci_setup_config_hdr(lm_ctx, id, ss, cc, false); if (ret < 0) { fprintf(stderr, "failed to setup pci header\n"); |