qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs
@ 2012-09-19 13:51 Peter Maydell
  2012-09-19 14:03 ` malc
  2012-09-19 17:07 ` Michael Tokarev
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2012-09-19 13:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

For architectures which don't set HAS_AUDIO_CHOICE, improve the
'-soundhw help' message so that it doesn't simply print an empty
list, implying no sound support at all.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 arch_init.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch_init.c b/arch_init.c
index 47977de..f849f9b 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -922,11 +922,16 @@ void select_soundhw(const char *optarg)
     if (is_help_option(optarg)) {
     show_valid_cards:
 
+#ifdef HAS_AUDIO_CHOICE
         printf("Valid sound card names (comma separated):\n");
         for (c = soundhw; c->name; ++c) {
             printf ("%-11s %s\n", c->name, c->descr);
         }
         printf("\n-soundhw all will enable all of the above\n");
+#else
+        printf("Machine has no user-selectable audio hardware "
+               "(it may or may not have always-present audio hardware).\n");
+#endif
         exit(!is_help_option(optarg));
     }
     else {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs
  2012-09-19 13:51 [Qemu-devel] [PATCH] arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs Peter Maydell
@ 2012-09-19 14:03 ` malc
  2012-09-19 17:07 ` Michael Tokarev
  1 sibling, 0 replies; 4+ messages in thread
From: malc @ 2012-09-19 14:03 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches

On Wed, 19 Sep 2012, Peter Maydell wrote:

> For architectures which don't set HAS_AUDIO_CHOICE, improve the
> '-soundhw help' message so that it doesn't simply print an empty
> list, implying no sound support at all.
> 

[..snip..]

Applied, thanks.

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs
  2012-09-19 13:51 [Qemu-devel] [PATCH] arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs Peter Maydell
  2012-09-19 14:03 ` malc
@ 2012-09-19 17:07 ` Michael Tokarev
  2012-09-19 17:12   ` Peter Maydell
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2012-09-19 17:07 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches

On 19.09.2012 17:51, Peter Maydell wrote:

> +#else
> +        printf("Machine has no user-selectable audio hardware "
> +               "(it may or may not have always-present audio hardware).\n");

Can't we add a linefeed here the same way it is written in the code?

/mjt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs
  2012-09-19 17:07 ` Michael Tokarev
@ 2012-09-19 17:12   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2012-09-19 17:12 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-devel, patches

On 19 September 2012 18:07, Michael Tokarev <mjt@tls.msk.ru> wrote:
> On 19.09.2012 17:51, Peter Maydell wrote:
>
>> +#else
>> +        printf("Machine has no user-selectable audio hardware "
>> +               "(it may or may not have always-present audio hardware).\n");
>
> Can't we add a linefeed here the same way it is written in the code?

Since there's no way to know how big the user's terminal is I
generally prefer to avoid linefeeds in error messages.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-19 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-19 13:51 [Qemu-devel] [PATCH] arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs Peter Maydell
2012-09-19 14:03 ` malc
2012-09-19 17:07 ` Michael Tokarev
2012-09-19 17:12   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).