qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fixed '-serial none' usage breaks following '-serial ...' usage
@ 2024-01-10  7:46 Bohdan Kostiv
  2024-01-12 18:30 ` Peter Maydell
  2024-01-15 16:14 ` Peter Maydell
  0 siblings, 2 replies; 6+ messages in thread
From: Bohdan Kostiv @ 2024-01-10  7:46 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 598 bytes --]

Hello,

I have faced an issue in using serial ports when I need to skip a couple of
ports in the CLI.

For example the ARM machine netduinoplus2 supports up to 7 UARTS.
Following case works (the first UART is used to send data in the firmware):
qemu-system-arm -machine netduinoplus2 -nographic -serial mon:stdio -kernel
path-to-fw/firmware.elf
But this one doesn't  (the third UART is used to send data in the firmware):
qemu-system-arm -machine netduinoplus2 -nographic -serial none -serial none
-serial mon:stdio -kernel path-to-fw/firmware.elf

The patch fixes the issue.

Best regards,
Bohdan

[-- Attachment #1.2: Type: text/html, Size: 1536 bytes --]

[-- Attachment #2: 0001-Fixed-serial-none-breaks-following-serial.patch --]
[-- Type: application/octet-stream, Size: 883 bytes --]

From ee8023f3d466c3a5ad9cb9d117e11501c44da377 Mon Sep 17 00:00:00 2001
From: Bohdan Kostiv <bogdan.kostiv@gmail.com>
Date: Wed, 10 Jan 2024 11:09:11 +0400
Subject: [PATCH] Fixed '-serial none' usage breaks following '-serial ...' usage 

Signed-off-by: Bohdan Kostiv <bohdan.kostiv@tii.ae>
---
 system/vl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/system/vl.c b/system/vl.c
index 2bcd9efb9a..b8744475cd 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1442,8 +1442,11 @@ static int serial_parse(const char *devname)
     int index = num_serial_hds;
     char label[32];
 
-    if (strcmp(devname, "none") == 0)
+    if (strcmp(devname, "none") == 0) {
+        num_serial_hds++;
         return 0;
+    }
+
     snprintf(label, sizeof(label), "serial%d", index);
     serial_hds = g_renew(Chardev *, serial_hds, index + 1);
 
-- 
2.39.3 (Apple Git-145)


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

end of thread, other threads:[~2024-01-22 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-10  7:46 [PATCH] Fixed '-serial none' usage breaks following '-serial ...' usage Bohdan Kostiv
2024-01-12 18:30 ` Peter Maydell
2024-01-15 16:14 ` Peter Maydell
2024-01-16  7:33   ` Markus Armbruster
2024-01-16 17:34   ` Daniel P. Berrangé
2024-01-22 15:54   ` 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).