diff options
author | John Levon <john.levon@nutanix.com> | 2020-11-17 11:39:59 +0000 |
---|---|---|
committer | John Levon <levon@movementarian.org> | 2020-11-18 10:30:51 +0000 |
commit | 943fe77b8099d4a9c5423320dc471a4ac14c634b (patch) | |
tree | 7d2b754348633f614ea0fe4b67e0e25bae1aa1b6 /samples | |
parent | 7085f28d6596dc12d82ea4386d106e340490d3fe (diff) | |
download | libvfio-user-943fe77b8099d4a9c5423320dc471a4ac14c634b.zip libvfio-user-943fe77b8099d4a9c5423320dc471a4ac14c634b.tar.gz libvfio-user-943fe77b8099d4a9c5423320dc471a4ac14c634b.tar.bz2 |
small cleanups post-muser.ko removal
Diffstat (limited to 'samples')
-rw-r--r-- | samples/gpio-pci-idio-16.c | 13 | ||||
-rw-r--r-- | samples/null.c | 2 | ||||
-rw-r--r-- | samples/server.c | 5 |
3 files changed, 8 insertions, 12 deletions
diff --git a/samples/gpio-pci-idio-16.c b/samples/gpio-pci-idio-16.c index d9bfa0e..3e47fc9 100644 --- a/samples/gpio-pci-idio-16.c +++ b/samples/gpio-pci-idio-16.c @@ -69,31 +69,28 @@ static void _sa_handler(UNUSED int signum) int main(int argc, char *argv[]) { int ret; - bool trans_sock = false, verbose = false; + bool verbose = false; char opt; struct sigaction act = {.sa_handler = _sa_handler}; lm_ctx_t *lm_ctx; - while ((opt = getopt(argc, argv, "sv")) != -1) { + while ((opt = getopt(argc, argv, "v")) != -1) { switch (opt) { - case 's': - trans_sock = true; - break; case 'v': verbose = true; break; default: /* '?' */ - fprintf(stderr, "Usage: %s [-s] [-d] <IOMMU group>\n", argv[0]); + fprintf(stderr, "Usage: %s [-v] <socketpath>\n", argv[0]); exit(EXIT_FAILURE); } } if (optind >= argc) { - err(EXIT_FAILURE, "missing MUSER device UUID"); + errx(EXIT_FAILURE, "missing MUSER socket path"); } lm_dev_info_t dev_info = { - .trans = trans_sock ? LM_TRANS_SOCK : LM_TRANS_KERNEL, + .trans = LM_TRANS_SOCK, .log = verbose ? _log : NULL, .log_lvl = LM_DBG, .pci_info = { diff --git a/samples/null.c b/samples/null.c index 2a16bf7..0253d05 100644 --- a/samples/null.c +++ b/samples/null.c @@ -74,7 +74,7 @@ int main(int argc, char **argv) pthread_t thread; if (argc != 2) { - err(EXIT_FAILURE, "missing MUSER device UUID"); + errx(EXIT_FAILURE, "missing MUSER socket path"); } lm_dev_info_t dev_info = {.uuid = argv[1], .log = null_log, .log_lvl = LM_DBG }; diff --git a/samples/server.c b/samples/server.c index 5e3c89e..c814c2e 100644 --- a/samples/server.c +++ b/samples/server.c @@ -299,14 +299,13 @@ int main(int argc, char *argv[]){ verbose = true; break; default: /* '?' */ - fprintf(stderr, "Usage: %s [-d] <IOMMU group>\n", argv[0]); + fprintf(stderr, "Usage: %s [-v] <socketpath>\n", argv[0]); exit(EXIT_FAILURE); } } if (optind >= argc) { - fprintf(stderr, "missing MUSER device UUID\n"); - exit(EXIT_FAILURE); + errx(EXIT_FAILURE, "missing MUSER socket path"); } server_data.bar1 = malloc(sysconf(_SC_PAGESIZE)); |