From 73c6e4013b4cd92d3d531bc22cc29e6036ef42e0 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 27 Jan 2016 08:49:21 +0100 Subject: rcu: completely disable pthread_atfork callbacks as soon as possible Because of -daemonize, system mode QEMU sometimes needs to fork() and keep RCU enabled in the child. However, there is a possible deadlock with synchronize_rcu: - the CPU thread is inside a RCU critical section and wants to take the BQL in order to do MMIO - the monitor thread, which is owning the BQL, calls rcu_init_lock which tries to take the rcu_sync_lock - the call_rcu thread has taken rcu_sync_lock in synchronize_rcu, but synchronize_rcu needs the CPU thread to end the critical section before returning. This cannot happen for user-mode emulation, because it does not have a BQL. To fix it, assume that system mode QEMU only forks in preparation for exec (except when daemonizing) and disable pthread_atfork as soon as the double fork has happened. Reported-by: Dr. David Alan Gilbert Tested-by: Dr. David Alan Gilbert Signed-off-by: Paolo Bonzini --- include/qemu/rcu.h | 6 ++++++ util/rcu.c | 20 ++++++++++++++++++++ vl.c | 1 + 3 files changed, 27 insertions(+) diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h index 83ae2808be..c0da9907e8 100644 --- a/include/qemu/rcu.h +++ b/include/qemu/rcu.h @@ -105,6 +105,12 @@ extern void synchronize_rcu(void); */ extern void rcu_register_thread(void); extern void rcu_unregister_thread(void); + +/* + * Support for fork(). fork() support is enabled at startup. + */ +extern void rcu_enable_atfork(void); +extern void rcu_disable_atfork(void); extern void rcu_after_fork(void); struct rcu_head; diff --git a/util/rcu.c b/util/rcu.c index 9adc5e4a36..2142ddd93b 100644 --- a/util/rcu.c +++ b/util/rcu.c @@ -318,15 +318,35 @@ static void rcu_init_complete(void) rcu_register_thread(); } +static int atfork_depth = 1; + +void rcu_enable_atfork(void) +{ + atfork_depth++; +} + +void rcu_disable_atfork(void) +{ + atfork_depth--; +} + #ifdef CONFIG_POSIX static void rcu_init_lock(void) { + if (atfork_depth < 1) { + return; + } + qemu_mutex_lock(&rcu_sync_lock); qemu_mutex_lock(&rcu_registry_lock); } static void rcu_init_unlock(void) { + if (atfork_depth < 1) { + return; + } + qemu_mutex_unlock(&rcu_registry_lock); qemu_mutex_unlock(&rcu_sync_lock); } diff --git a/vl.c b/vl.c index 99fcfa0442..8967115514 100644 --- a/vl.c +++ b/vl.c @@ -4121,6 +4121,7 @@ int main(int argc, char **argv, char **envp) set_memory_options(&ram_slots, &maxram_size, machine_class); os_daemonize(); + rcu_disable_atfork(); if (pid_file && qemu_create_pidfile(pid_file) != 0) { error_report("could not acquire pid file: %s", strerror(errno)); -- cgit v1.2.3 From 2a96a552f9502ac34c29da2f3a39788db5ee5692 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 25 Mar 2016 14:00:51 +0100 Subject: Revert "rcu: do not create thread in pthread_atfork callback" This reverts commit a59629fcc6f603e19b516dc08f75334e5c480bd0. This is not needed anymore because the IOThread mutex is not "magic" anymore (need not kick the CPU thread)and also because fork callbacks are only enabled at the very beginning of QEMU's execution. Signed-off-by: Paolo Bonzini --- include/qemu/rcu.h | 1 - linux-user/syscall.c | 1 - os-posix.c | 2 -- util/rcu.c | 10 +++++++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h index c0da9907e8..f19413d649 100644 --- a/include/qemu/rcu.h +++ b/include/qemu/rcu.h @@ -111,7 +111,6 @@ extern void rcu_unregister_thread(void); */ extern void rcu_enable_atfork(void); extern void rcu_disable_atfork(void); -extern void rcu_after_fork(void); struct rcu_head; typedef void RCUCBFunc(struct rcu_head *head); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 54343c06be..9b6364a266 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6354,7 +6354,6 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, ret = fork(); if (ret == 0) { /* Child Process. */ - rcu_after_fork(); cpu_clone_regs(env, newsp); fork_end(1); /* There is a race condition here. The parent process could diff --git a/os-posix.c b/os-posix.c index c6ddb7d830..92e9d85215 100644 --- a/os-posix.c +++ b/os-posix.c @@ -34,7 +34,6 @@ #include "sysemu/sysemu.h" #include "net/slirp.h" #include "qemu-options.h" -#include "qemu/rcu.h" #include "qemu/error-report.h" #include "qemu/log.h" #include "qemu/cutils.h" @@ -249,7 +248,6 @@ void os_daemonize(void) signal(SIGTSTP, SIG_IGN); signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); - rcu_after_fork(); } } diff --git a/util/rcu.c b/util/rcu.c index 2142ddd93b..ca5a63e36a 100644 --- a/util/rcu.c +++ b/util/rcu.c @@ -350,18 +350,22 @@ static void rcu_init_unlock(void) qemu_mutex_unlock(&rcu_registry_lock); qemu_mutex_unlock(&rcu_sync_lock); } -#endif -void rcu_after_fork(void) +static void rcu_init_child(void) { + if (atfork_depth < 1) { + return; + } + memset(®istry, 0, sizeof(registry)); rcu_init_complete(); } +#endif static void __attribute__((__constructor__)) rcu_init(void) { #ifdef CONFIG_POSIX - pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_unlock); + pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_child); #endif rcu_init_complete(); } -- cgit v1.2.3 From 1b7ac7cab6a9abaf686fe7a7f4afea155c03d6a8 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Mon, 7 Aug 2017 13:36:44 +0200 Subject: kvm: workaround build break on gcc-7.1.1 / fedora26 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building QEMU on fedora26 with the latest gcc package fails: CC ppc64-softmmu/target/ppc/kvm.o In file included from include/sysemu/hw_accel.h:16:0, from target/ppc/kvm.c:31: target/ppc/kvm.c: In function ‘kvmppc_booke_watchdog_enable’: include/sysemu/kvm.h:449:35: error: ‘args_tmp[i]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] cap.args[i] = args_tmp[i]; \ ^ target/ppc/kvm.c: In function ‘kvmppc_set_papr’: include/sysemu/kvm.h:449:35: error: ‘args_tmp[i]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] cc1: all warnings being treated as errors $ rpm -q gcc gcc-7.1.1-3.fc26.ppc64le The compiler should obviously optimize this code away when no extra agument is passed to kvm_vm_enable_cap() and kvm_vcpu_enable_cap(), but it doesn't. This bug should be fixed one day in gcc, but we can also change our code pattern so that we don't hit the issue anymore. We workaround this, by using memcpy() instead of open-coding the copy. Signed-off-by: Greg Kurz Message-Id: <150210580404.1343.7325713896658799315.stgit@bahia.lan> Acked-by: Cornelia Huck Signed-off-by: Paolo Bonzini --- include/sysemu/kvm.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 91fc07ee9a..3a458f50e9 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -428,11 +428,8 @@ int kvm_vm_check_extension(KVMState *s, unsigned int extension); .flags = cap_flags, \ }; \ uint64_t args_tmp[] = { __VA_ARGS__ }; \ - int i; \ - for (i = 0; i < (int)ARRAY_SIZE(args_tmp) && \ - i < ARRAY_SIZE(cap.args); i++) { \ - cap.args[i] = args_tmp[i]; \ - } \ + size_t n = MIN(ARRAY_SIZE(args_tmp), ARRAY_SIZE(cap.args)); \ + memcpy(cap.args, args_tmp, n * sizeof(cap.args[0])); \ kvm_vm_ioctl(s, KVM_ENABLE_CAP, &cap); \ }) @@ -443,11 +440,8 @@ int kvm_vm_check_extension(KVMState *s, unsigned int extension); .flags = cap_flags, \ }; \ uint64_t args_tmp[] = { __VA_ARGS__ }; \ - int i; \ - for (i = 0; i < (int)ARRAY_SIZE(args_tmp) && \ - i < ARRAY_SIZE(cap.args); i++) { \ - cap.args[i] = args_tmp[i]; \ - } \ + size_t n = MIN(ARRAY_SIZE(args_tmp), ARRAY_SIZE(cap.args)); \ + memcpy(cap.args, args_tmp, n * sizeof(cap.args[0])); \ kvm_vcpu_ioctl(cpu, KVM_ENABLE_CAP, &cap); \ }) -- cgit v1.2.3 From ded6ddc5a7b95217557fa360913d1213e12d4a6d Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Fri, 4 Aug 2017 10:36:34 +0200 Subject: scsi: clarify sense codes for LUN0 emulation The LUN0 emulation is just that, an emulation for a non-existing LUN0. So we should be returning LUN_NOT_SUPPORTED for any request coming from any other LUN. And we should be aborting unhandled commands with INVALID OPCODE, not LUN NOT SUPPORTED. Signed-off-by: Hannes Reinecke Message-Id: <1501835795-92331-4-git-send-email-hare@suse.de> Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 23c51de66a..e364410a23 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -517,6 +517,11 @@ static int32_t scsi_target_send_command(SCSIRequest *req, uint8_t *buf) { SCSITargetReq *r = DO_UPCAST(SCSITargetReq, req, req); + if (req->lun != 0) { + scsi_req_build_sense(req, SENSE_CODE(LUN_NOT_SUPPORTED)); + scsi_req_complete(req, CHECK_CONDITION); + return 0; + } switch (buf[0]) { case REPORT_LUNS: if (!scsi_target_emulate_report_luns(r)) { @@ -542,7 +547,7 @@ static int32_t scsi_target_send_command(SCSIRequest *req, uint8_t *buf) case TEST_UNIT_READY: break; default: - scsi_req_build_sense(req, SENSE_CODE(LUN_NOT_SUPPORTED)); + scsi_req_build_sense(req, SENSE_CODE(INVALID_OPCODE)); scsi_req_complete(req, CHECK_CONDITION); return 0; illegal_request: -- cgit v1.2.3 From ab6ab3e9972a49a359f59895a88bed311472ca97 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 8 Aug 2017 00:43:38 +0000 Subject: target/i386: set rip_offset for some SSE4.1 instructions When emulating various SSE4.1 instructions such as pinsrd, the address of a memory operand is computed without allowing for the 8-bit immediate operand located after the memory operand, meaning that the memory operand uses the wrong address in the case where it is rip-relative. This patch adds the required rip_offset setting for those instructions, so fixing some GCC test failures (13 in the gcc testsuite in my GCC 6-based testing) when testing with a default CPU setting enabling those instructions. Signed-off-by: Joseph Myers Message-Id: Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index cab9e32f91..5fdadf98cf 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4080,6 +4080,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, if (sse_fn_eppi == SSE_SPECIAL) { ot = mo_64_32(s->dflag); rm = (modrm & 7) | REX_B(s); + s->rip_offset = 1; if (mod != 3) gen_lea_modrm(env, s, modrm); reg = ((modrm >> 3) & 7) | rex_r; -- cgit v1.2.3 From 57b2d9d4a7155f516c3ffeec88f83867d0a99c4a Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 3 Aug 2017 11:33:50 -0500 Subject: qemu-img: Sort sub-command names in --help 'amend' and 'create' were not listed alphabetically; hoist them earlier. Separate the @end table block to make it easier to copy-and-paste the addition of future sub-commands. Signed-off-by: Eric Blake Message-Id: <20170803163353.19558-2-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-img-cmds.hx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 3763f13625..b47d409665 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -1,3 +1,4 @@ +HXCOMM Keep the list of subcommands sorted by name. HXCOMM Use DEFHEADING() to define headings in both help text and texi HXCOMM Text between STEXI and ETEXI are copied to texi version and HXCOMM discarded from C version @@ -9,6 +10,12 @@ STEXI @table @option ETEXI +DEF("amend", img_amend, + "amend [--object objectdef] [--image-opts] [-p] [-q] [-f fmt] [-t cache] -o options filename") +STEXI +@item amend [--object @var{objectdef}] [--image-opts] [-p] [-q] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} +ETEXI + DEF("bench", img_bench, "bench [-c count] [-d depth] [-f fmt] [--flush-interval=flush_interval] [-n] [--no-drain] [-o offset] [--pattern=pattern] [-q] [-s buffer_size] [-S step_size] [-t cache] [-w] [-U] filename") STEXI @@ -21,12 +28,6 @@ STEXI @item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{filename} ETEXI -DEF("create", img_create, - "create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]") -STEXI -@item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] -ETEXI - DEF("commit", img_commit, "commit [-q] [--object objectdef] [--image-opts] [-f fmt] [-t cache] [-b base] [-d] [-p] filename") STEXI @@ -45,6 +46,12 @@ STEXI @item convert [--object @var{objectdef}] [--image-opts] [--target-image-opts] [-U] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}] [-W] @var{filename} [@var{filename2} [...]] @var{output_filename} ETEXI +DEF("create", img_create, + "create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]") +STEXI +@item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] +ETEXI + DEF("dd", img_dd, "dd [--image-opts] [-U] [-f fmt] [-O output_fmt] [bs=block_size] [count=blocks] [skip=blocks] if=input of=output") STEXI @@ -87,9 +94,6 @@ STEXI @item resize [--object @var{objectdef}] [--image-opts] [-q] @var{filename} [+ | -]@var{size} ETEXI -DEF("amend", img_amend, - "amend [--object objectdef] [--image-opts] [-p] [-q] [-f fmt] [-t cache] -o options filename") STEXI -@item amend [--object @var{objectdef}] [--image-opts] [-p] [-q] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} @end table ETEXI -- cgit v1.2.3 From 4face32a7a89cc135f9589cabaced69a445a53b9 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 3 Aug 2017 11:33:51 -0500 Subject: qemu-io: Give more --version information Include the package version information (useful for detecting builds from git or downstream backports), and the copyright notice. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange Acked-by: Kevin Wolf Message-Id: <20170803163353.19558-3-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qemu-io.c b/qemu-io.c index 4cfa41c8f9..ec175630a6 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -26,6 +26,7 @@ #include "block/block_int.h" #include "trace/control.h" #include "crypto/init.h" +#include "qemu-version.h" #define CMD_NOFILE_OK 0x01 @@ -522,7 +523,8 @@ int main(int argc, char **argv) trace_file = trace_opt_parse(optarg); break; case 'V': - printf("%s version %s\n", progname, QEMU_VERSION); + printf("%s version " QEMU_VERSION QEMU_PKGVERSION "\n" + QEMU_COPYRIGHT "\n", progname); exit(0); case 'h': usage(progname); -- cgit v1.2.3 From 8f1c29af01c80183d7bd9166690212929a46ad48 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 3 Aug 2017 11:33:52 -0500 Subject: qga: Give more --version information Include the package version information (useful for detecting builds from git or downstream backports), and the copyright notice. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange Message-Id: <20170803163353.19558-4-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- qga/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qga/main.c b/qga/main.c index 1b381d0bf3..b64c7ac2a2 100644 --- a/qga/main.c +++ b/qga/main.c @@ -29,6 +29,7 @@ #include "qemu/help_option.h" #include "qemu/sockets.h" #include "qemu/systemd.h" +#include "qemu-version.h" #ifdef _WIN32 #include "qga/service-win32.h" #include "qga/vss-win32.h" @@ -213,7 +214,8 @@ static void usage(const char *cmd) { printf( "Usage: %s [-m -p ] []\n" -"QEMU Guest Agent %s\n" +"QEMU Guest Agent " QEMU_VERSION QEMU_PKGVERSION "\n" +QEMU_COPYRIGHT "\n" "\n" " -m, --method transport method: one of unix-listen, virtio-serial,\n" " isa-serial, or vsock-listen (virtio-serial is the default)\n" @@ -248,7 +250,7 @@ static void usage(const char *cmd) " -h, --help display this help and exit\n" "\n" "Report bugs to \n" - , cmd, QEMU_VERSION, QGA_VIRTIO_PATH_DEFAULT, QGA_SERIAL_PATH_DEFAULT, + , cmd, QGA_VIRTIO_PATH_DEFAULT, QGA_SERIAL_PATH_DEFAULT, dfl_pathnames.pidfile, #ifdef CONFIG_FSFREEZE QGA_FSFREEZE_HOOK_DEFAULT, -- cgit v1.2.3 From f5048cb7517348a20ba202e435e1006a8f5001cf Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 3 Aug 2017 11:33:53 -0500 Subject: maint: Include bug-reporting info in --help output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These days, many programs are including a bug-reporting address, or better yet, a link to the project web site, at the tail of their --help output. However, we were not very consistent at doing so: only qemu-nbd and qemu-qa mentioned anything, with the latter pointing to an individual person instead of the project. Add a new #define that sets up a uniform string, mentioning both bug reporting instructions and overall project details, and which a downstream vendor could tweak if they want bugs to go to a downstream database. Then use it in all of our binaries which have --help output. The canned text intentionally references http:// instead of https:// because our https website currently causes certificate errors in some browsers. That can be tweaked later once we have resolved the web site issued. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20170803163353.19558-5-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- bsd-user/main.c | 2 ++ include/qemu-common.h | 5 +++++ linux-user/main.c | 4 +++- qemu-img.c | 2 +- qemu-io.c | 5 +++-- qemu-nbd.c | 2 +- qga/main.c | 2 +- vl.c | 4 +++- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 501e16f675..8a6706a1c8 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -686,6 +686,8 @@ static void usage(void) " -E var1=val2 -E var2=val2 -U LD_PRELOAD -U LD_DEBUG\n" "Note that if you provide several changes to single variable\n" "last change will stay in effect.\n" + "\n" + QEMU_HELP_BOTTOM "\n" , TARGET_NAME, interp_prefix, diff --git a/include/qemu-common.h b/include/qemu-common.h index b5adbfa5e9..0456c79df4 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -22,6 +22,11 @@ #define QEMU_COPYRIGHT "Copyright (c) 2003-2017 " \ "Fabrice Bellard and the QEMU Project developers" +/* Bug reporting information for --help arguments, About dialogs, etc */ +#define QEMU_HELP_BOTTOM \ + "See for how to report bugs.\n" \ + "More information on the QEMU project at ." + /* main function, renamed */ #if defined(CONFIG_COCOA) int qemu_main(int argc, char **argv, char **envp); diff --git a/linux-user/main.c b/linux-user/main.c index 2b38d39d87..03666ef657 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4136,7 +4136,9 @@ static void usage(int exitcode) " -E var1=val2,var2=val2 -U LD_PRELOAD,LD_DEBUG\n" " QEMU_SET_ENV=var1=val2,var2=val2 QEMU_UNSET_ENV=LD_PRELOAD,LD_DEBUG\n" "Note that if you provide several changes to a single variable\n" - "the last change will stay in effect.\n"); + "the last change will stay in effect.\n" + "\n" + QEMU_HELP_BOTTOM "\n"); exit(exitcode); } diff --git a/qemu-img.c b/qemu-img.c index f4d5f0d77d..56ef49e214 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -201,7 +201,7 @@ static void QEMU_NORETURN help(void) printf("%s\nSupported formats:", help_msg); bdrv_iterate_format(format_print, NULL); - printf("\n"); + printf("\n\n" QEMU_HELP_BOTTOM "\n"); exit(EXIT_SUCCESS); } diff --git a/qemu-io.c b/qemu-io.c index ec175630a6..265445ad89 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -262,8 +262,9 @@ static void usage(const char *name) " -h, --help display this help and exit\n" " -V, --version output version information and exit\n" "\n" -"See '%s -c help' for information on available commands." -"\n", +"See '%s -c help' for information on available commands.\n" +"\n" +QEMU_HELP_BOTTOM "\n", name, name); } diff --git a/qemu-nbd.c b/qemu-nbd.c index b8666bb575..27164b8205 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -123,7 +123,7 @@ static void usage(const char *name) " --detect-zeroes=MODE set detect-zeroes mode (off, on, unmap)\n" " --image-opts treat FILE as a full set of image options\n" "\n" -"Report bugs to \n" +QEMU_HELP_BOTTOM "\n" , name, NBD_DEFAULT_PORT, "DEVICE"); } diff --git a/qga/main.c b/qga/main.c index b64c7ac2a2..62a62755bd 100644 --- a/qga/main.c +++ b/qga/main.c @@ -249,7 +249,7 @@ QEMU_COPYRIGHT "\n" " options / command-line parameters to stdout\n" " -h, --help display this help and exit\n" "\n" -"Report bugs to \n" +QEMU_HELP_BOTTOM "\n" , cmd, QGA_VIRTIO_PATH_DEFAULT, QGA_SERIAL_PATH_DEFAULT, dfl_pathnames.pidfile, #ifdef CONFIG_FSFREEZE diff --git a/vl.c b/vl.c index 8967115514..8e247cc2a2 100644 --- a/vl.c +++ b/vl.c @@ -1942,7 +1942,9 @@ static void help(int exitcode) "ctrl-alt-n switch to virtual console 'n'\n" "ctrl-alt toggle mouse and keyboard grab\n" "\n" - "When using -nographic, press 'ctrl-a h' to get some help.\n"); + "When using -nographic, press 'ctrl-a h' to get some help.\n" + "\n" + QEMU_HELP_BOTTOM "\n"); exit(exitcode); } -- cgit v1.2.3