Skip to contentSkip to conversation

Don't set default monitor when there is a mux'ed one

PATCH Superseded Jan Kiszka 3 participants 4 messages Jan 14, 2010

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Don't set default monitor when there is a mux'ed one

This fixes eg. "-nographic -serial mon:stdio [-serial ...]".

---

 vl.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
vl.c +9 -0
index 06cb40d..fa3e8ee 100644
@@ -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);
#2 lore raw
In reply to Jan Kiszka
Quoted 2 lines · Jan Kiszka

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

author
#3 lore raw
Quoted 8 lines · Anthony Liguori
Quoted 2 lines · Jan Kiszka

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

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux