Patchwork [STABLE] Don't set default monitor when there is a mux'ed one

login
register
mail settings
Submitter Jan Kiszka
Date Jan. 14, 2010, 2:49 p.m.
Message ID <4B4F2F06.2040301@siemens.com>
Download mbox | patch
Permalink /patch/42895/
State New
Headers show

Comments

Jan Kiszka - Jan. 14, 2010, 2:49 p.m.
This fixes eg. "-nographic -serial mon:stdio [-serial ...]".

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 vl.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
Gerd Hoffmann - Jan. 14, 2010, 2:58 p.m.
On 01/14/10 15:49, Jan Kiszka wrote:
> This fixes eg. "-nographic -serial mon:stdio [-serial ...]".

Looks good to me.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

cheers,
   Gerd
Anthony Liguori - Jan. 14, 2010, 3:07 p.m.
On 01/14/2010 08:49 AM, Jan Kiszka wrote:
> This fixes eg. "-nographic -serial mon:stdio [-serial ...]".
>    

Is this really an appropriate invocation though?

-nographic != mon:stdio so the semantics of how this is supposed to 
behave is at best ill-defined.

Regards,

Anthony Liguori
Jan Kiszka - Jan. 14, 2010, 3:19 p.m.
Anthony Liguori wrote:
> On 01/14/2010 08:49 AM, Jan Kiszka wrote:
>> This fixes eg. "-nographic -serial mon:stdio [-serial ...]".
>>    
> 
> Is this really an appropriate invocation though?
> 
> -nographic != mon:stdio so the semantics of how this is supposed to 
> behave is at best ill-defined.

Original -nographic implied mon:stdio unless you specified your own
-serial. If this was reasonable or not, changing behavior now breaks
tons of scripts.

Actually, there is more legacy breakage in the new default handling. The
missing translation of "-serial stdio -monitor stdio" => "-serial
mon:stdio" can already be harmful to some setups, though I guess they
are less common.

However, this patch addresses something that is a bug outside the scope
of -nographic's semantic.

Jan

Patch

diff --git a/vl.c b/vl.c
index 06cb40d..fa3e8ee 100644
--- a/vl.c
+++ b/vl.c
@@ -5171,6 +5171,9 @@  int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_serial:
                 add_device_config(DEV_SERIAL, optarg);
                 default_serial = 0;
+                if (strncmp(optarg, "mon:", 4) == 0) {
+                    default_monitor = 0;
+                }
                 break;
             case QEMU_OPTION_watchdog:
                 if (watchdog) {
@@ -5189,10 +5192,16 @@  int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_virtiocon:
                 add_device_config(DEV_VIRTCON, optarg);
                 default_virtcon = 0;
+                if (strncmp(optarg, "mon:", 4) == 0) {
+                    default_monitor = 0;
+                }
                 break;
             case QEMU_OPTION_parallel:
                 add_device_config(DEV_PARALLEL, optarg);
                 default_parallel = 0;
+                if (strncmp(optarg, "mon:", 4) == 0) {
+                    default_monitor = 0;
+                }
                 break;
             case QEMU_OPTION_debugcon:
                 add_device_config(DEV_DEBUGCON, optarg);