@samitouri / QOSamiQemu / commits / 451bdd977f

vl: fix -monitor none prefix matching

Use g_strcmp0() for exact match instead of strncmp() which would incorrectly treat any string starting with "none" as disabling the monitor. Fixes: 70e098af88f ("monitor: allow to disable the default monitor") Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260828-qemu-no-hmp-v5-2-9227de146347@redhat.com>

Marc-André Lureau committed Aug 28, 2026 at 16:03 UTC 451bdd977f8534821f9793dba8b9eaf93a981af6
1 file changed +1 -1
system/vl.c
+1 -1
@@ -3226,7 +3226,7 @@ void qemu_init(int argc, char **argv)
3226 }
3227 case QEMU_OPTION_monitor:
3228 default_monitor = 0;
3229 - if (strncmp(optarg, "none", 4)) {
3229 + if (g_strcmp0(optarg, "none")) {
3230 monitor_parse(optarg, "readline", false);
3231 }
3232 break;