diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-03-06 13:24:35 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-03-06 13:24:35 +0000 |
commit | b5fe11a49ad3df109bfb32dea2f2ef74d1d3ca13 (patch) | |
tree | c9007e013761351acda3bbc000e36d192a180827 /fsdev | |
parent | 58e2e17dba49b43f4ac9de19468aeae1c787dcc2 (diff) | |
parent | 3e015d815b3f28bfd874bf8a1697308ef9af2b4c (diff) |
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* new QMP command qom-list-properties (Alexey)
* TCG cleanups (David)
* use g_path_get_basename/g_path_get_dirname when useful (Julia)
* WHPX fixes (Justin)
* ASAN fixes (Marc-André)
* g364fb memory leak fix, address_space_to_flatview RCU fixes (me)
* chardev memory leak fix (Peter)
* checkpatch improvements (Julia, Su Hang)
* next round of deprecation patches (Thomas)
# gpg: Signature made Tue 06 Mar 2018 13:11:58 GMT
# gpg: using RSA key BFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg: aka "Paolo Bonzini <pbonzini@redhat.com>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1
# Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83
* remotes/bonzini/tags/for-upstream: (34 commits)
use g_path_get_basename instead of basename
balloon: Fix documentation of the --balloon parameter and deprecate it
WHPX improve interrupt notification registration
WHXP Removes the use of WHvGetExitContextSize
Fix WHPX issue leaking tpr values
Fix WHPX typo in 'mmio'
Fix WHPX additional lock acquisition
Remove unnecessary WHPX __debugbreak();
Resolves WHPX breaking changes in SDK 17095
Fixing WHPX casing to match SDK
Revert "build-sys: compile with -Og or -O1 when --enable-debug"
checkpatch: add check for `while` and `for`
checkpatch: add a warning for basename/dirname
address_space_rw: address_space_to_flatview needs RCU lock
address_space_map: address_space_to_flatview needs RCU lock
address_space_access_valid: address_space_to_flatview needs RCU lock
address_space_read: address_space_to_flatview needs RCU lock
address_space_write: address_space_to_flatview needs RCU lock
memory: inline some performance-sensitive accessors
openpic_kvm: drop address_space_to_flatview call
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'fsdev')
-rw-r--r-- | fsdev/virtfs-proxy-helper.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 8e48500dd5..6f132c5ff1 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -55,6 +55,7 @@ static struct option helper_opts[] = { static bool is_daemon; static bool get_version; /* IOC getversion IOCTL supported */ +static char *prog_name; static void GCC_FMT_ATTR(2, 3) do_log(int loglevel, const char *format, ...) { @@ -785,7 +786,7 @@ error: return -1; } -static void usage(char *prog) +static void usage(void) { fprintf(stderr, "usage: %s\n" " -p|--path <path> 9p path to export\n" @@ -795,7 +796,7 @@ static void usage(char *prog) " access to this socket\n" " \tNote: -s & -f can not be used together\n" " [-n|--nodaemon] Run as a normal program\n", - basename(prog)); + prog_name); } static int process_reply(int sock, int type, @@ -1045,6 +1046,8 @@ int main(int argc, char **argv) struct statfs st_fs; #endif + prog_name = g_path_get_basename(argv[0]); + is_daemon = true; sock = -1; own_u = own_g = -1; @@ -1077,7 +1080,7 @@ int main(int argc, char **argv) case '?': case 'h': default: - usage(argv[0]); + usage(); exit(EXIT_FAILURE); } } @@ -1085,13 +1088,13 @@ int main(int argc, char **argv) /* Parameter validation */ if ((sock_name == NULL && sock == -1) || rpath == NULL) { fprintf(stderr, "socket, socket descriptor or path not specified\n"); - usage(argv[0]); + usage(); return -1; } if (sock_name && sock != -1) { fprintf(stderr, "both named socket and socket descriptor specified\n"); - usage(argv[0]); + usage(); exit(EXIT_FAILURE); } @@ -1099,7 +1102,7 @@ int main(int argc, char **argv) fprintf(stderr, "owner uid:gid not specified, "); fprintf(stderr, "owner uid:gid specifies who can access the socket file\n"); - usage(argv[0]); + usage(); exit(EXIT_FAILURE); } |