From patchwork Mon Jan 22 16:36:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 764666 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1190523wrx; Mon, 22 Jan 2024 08:37:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGd8qfjz773gInt3+WKzFcS/QfwGe5ZVbDIErExeCS4nRpBiy7k70vwZA3NIH7k/fUNWtgV X-Received: by 2002:a05:620a:ed2:b0:783:4a7f:9049 with SMTP id x18-20020a05620a0ed200b007834a7f9049mr4248779qkm.68.1705941479660; Mon, 22 Jan 2024 08:37:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705941479; cv=none; d=google.com; s=arc-20160816; b=Tt2y8DuNgpLCg7iUHRMiSvgjKO9Jtjl14h0yEfSWqvkbf4XWprluwmOmKjRSCJG+bE 05+9iEzYUJF/Z/2ak95srV+cVcqE+bHkZAbKcS7SE3hHZm2Pt7wUJjP+MnztfuNN1zAK Yo44JiVX4Z8sz1gwxGuowpyI+MHGnyFGy1nwC9s4dgtECR07EFW3EncF7M2Gg/3BszDy j81oTxYwUqVVmvAjP3wGX9MzyW1XD11vfG7FTYHzMxYPjd6SECJ8tRLbo0wId3coWers LCaHNA8aBZZurbZMvxVAFbIBuGLYGWmDAsU+U9IxdOqRicdY750bEpOiTq59nTF6nbFS zvWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zbnfC/D4PDNYwfVyZ7HdEI62GO35WnzElpqTdsyXzQU=; fh=xqfGstDbu7aCFWLxVuN6wPNU466mOcXy68bYoEYguJc=; b=EhaLMeV6gmZT0Oh2t6ZcpGyYLTXf6phFQAG4u8TkPSni0oIjKtb+tCtyiDWxJuPj3k dhomNduFktCMYiLYBDb3Tzi5zEgVgoOLYzKj+T7ePB26gAIXOUV/PJ7mU18s8fzZWaDV pHRnMEH2wqoGQq/KmhgF30Bw0vJZvLxRx+eiyoDHAN3RWG9ulW961cnaE7AislyOyArT sd4Mh6ilIH3dc85punY1zhYm6QBJvHC/ZMQnJLvzEA7TvRbIjMiPaMDC586YMk1NPkTl LsozwZ9RJVahnqDimeTrnnSEO5lcrIfaRN2XNNUZsAfDhbasAkJLOImQv2nS6AwgmlSz 7rbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aX96wJ11; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f16-20020a05620a12f000b007839396fca8si5232559qkl.134.2024.01.22.08.37.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2024 08:37:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aX96wJ11; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRxHz-0004Dx-Op; Mon, 22 Jan 2024 11:36:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRxHW-00048h-Ha for qemu-devel@nongnu.org; Mon, 22 Jan 2024 11:36:20 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRxHQ-0001hN-Mm for qemu-devel@nongnu.org; Mon, 22 Jan 2024 11:36:16 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-337cc8e72f5so3111806f8f.1 for ; Mon, 22 Jan 2024 08:36:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705941370; x=1706546170; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zbnfC/D4PDNYwfVyZ7HdEI62GO35WnzElpqTdsyXzQU=; b=aX96wJ11TghmOeWa23BuzcsZG5wB6tO9hujD/cd/30F+dPCK0Ns2DwQGE/lGaEG4+l kF5hQuae9BYmmBNEBjS3nav7aRU+TK9LFR3qhf0NWXRsj9H0DepRgZ1izZMSPokPV0FK C84iaPDCDxbCrSs9vJ5b6XxhtN50xR0u13Ht3tlNbPVo/K+kO8z/NIzQT47FT61SQhxy SGeEoOnHEIqdJnVzJCJnnLiAajb31UqizqqUB1ovXQz/NmGUxg+xrYbHrDRY48tWnyTD 5hkjt/KGGppLgGOpNAGbZrwncisWVEzV5c4JQrw86+NsNOb5gsbSO9z46vGVlNvnPK6H ZsDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705941370; x=1706546170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zbnfC/D4PDNYwfVyZ7HdEI62GO35WnzElpqTdsyXzQU=; b=oQUDw44MQuW1PvRIiZqbbAd8RhkYL6Fb9/QT4HdXtF7GDF0IUVvfBbTAqKr4tr28FG knHYs47Epq5c+ZYRGThInYKJZE9WUwUEl/6cVuAvFWLED+mAGtudFkP7Z6x2NnrB6C0x IOZcjUDDlhpl5jMY5jRO1QV1KBAiUUj/HuAWNXlhdmKem7ZR0jBGGzIG39ojsdgozGPP ffLXxHHMkWleZA7BSioSio4ZyX5X3K39OGbbTZaSpcglTzE/ctyH7uczmcpF2vtbMgis T+2a4YcpeV1R6LOT/Tt+qfse+h1p0xHMQ27sjKhdwuB9WeHzy90bCxdA6ghsxD1s+yEZ +aAQ== X-Gm-Message-State: AOJu0YwwEru7Cb6x5aTg53gazp8czrH95yWt8f7n7JBAFk0RgczFjjzo T+3vZDohmgjTaIluA9P9e9UfZRVC287hIt/oFf8wXDLnmnVibXQDa5kPNDrUW2mbNF4L54+GsxY k X-Received: by 2002:a05:6000:d88:b0:337:b9ac:97f6 with SMTP id dv8-20020a0560000d8800b00337b9ac97f6mr2393941wrb.55.1705941369834; Mon, 22 Jan 2024 08:36:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e15-20020a5d530f000000b003391720fa51sm9188728wrv.60.2024.01.22.08.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 08:36:09 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Bohdan Kostiv , Markus Armbruster , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PATCH 1/2] system/vl.c: Fix handling of '-serial none -serial something' Date: Mon, 22 Jan 2024 16:36:06 +0000 Message-Id: <20240122163607.459769-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240122163607.459769-1-peter.maydell@linaro.org> References: <20240122163607.459769-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Currently if the user passes multiple -serial options on the command line, we mostly treat those as applying to the different serial devices in order, so that for example -serial stdio -serial file:filename will connect the first serial port to stdio and the second to the named file. The exception to this is the '-serial none' serial device type. This means "don't allocate this serial device", but a bug means that following -serial options are not correctly handled, so that -serial none -serial stdio has the unexpected effect that stdio is connected to the first serial port, not the second. This is a very long-standing bug that dates back at least as far as commit 998bbd74b9d81 from 2009. Make the 'none' serial type move forward in the indexing of serial devices like all the other serial types, so that any subsequent -serial options are correctly handled. Note that if your commandline mistakenly had a '-serial none' that was being overridden by a following '-serial something' option, you should delete the unnecessary '-serial none'. This will give you the same behaviour as before, on QEMU versions both with and without this bug fix. Cc: qemu-stable@nongnu.org Reported-by: Bohdan Kostiv Fixes: 998bbd74b9d81 ("default devices: core code & serial lines") Signed-off-by: Peter Maydell Reviewed-by: Daniel P. Berrangé Reviewed-by: Richard Henderson --- See the discussion of Bohdan's patch on the mailing list for further context: https://lore.kernel.org/qemu-devel/CAA3Sv1LQ8yDUNLCB5WqLVZjsHffrU0uSbL_YYJW_m+Db2PhEeQ@mail.gmail.com/ --- system/vl.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/system/vl.c b/system/vl.c index 788d88ea03a..aa7953bdd7d 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1439,18 +1439,22 @@ static void qemu_create_default_devices(void) static int serial_parse(const char *devname) { int index = num_serial_hds; - char label[32]; - if (strcmp(devname, "none") == 0) - return 0; - snprintf(label, sizeof(label), "serial%d", index); serial_hds = g_renew(Chardev *, serial_hds, index + 1); - serial_hds[index] = qemu_chr_new_mux_mon(label, devname, NULL); - if (!serial_hds[index]) { - error_report("could not connect serial device" - " to character backend '%s'", devname); - return -1; + if (strcmp(devname, "none") == 0) { + /* Don't allocate a serial device for this index */ + serial_hds[index] = NULL; + } else { + char label[32]; + snprintf(label, sizeof(label), "serial%d", index); + + serial_hds[index] = qemu_chr_new_mux_mon(label, devname, NULL); + if (!serial_hds[index]) { + error_report("could not connect serial device" + " to character backend '%s'", devname); + return -1; + } } num_serial_hds++; return 0; From patchwork Mon Jan 22 16:36:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 764664 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1190378wrx; Mon, 22 Jan 2024 08:37:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDElEbWthZBF/vm+zqEeJg9svDRHUqtL+JyNm/ALt/pXuk2TTaVTcbKZM1+vhq9nI0VB/c X-Received: by 2002:a05:6808:148c:b0:3bd:b8d5:23f3 with SMTP id e12-20020a056808148c00b003bdb8d523f3mr2090349oiw.32.1705941455757; Mon, 22 Jan 2024 08:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705941455; cv=none; d=google.com; s=arc-20160816; b=WHSAX89VKqOP8myHV0qe+xDv/FGgZDr38s1WQIMlHSzEEYMpwlX+GDNNBhdrRzzr9X wOVMBce/pG99YdItLgAC5kIM8dCo27WaMGQKYHAK0FhEytRffUfHyb7PIdUqkjnxuQH4 +kURQANPvOikKfE0P8CY4XeOa+J9OC3Wzq1EZng102E/j4/9VU2qaoQxaacdGF9yGBXN ujvahjcS9Pfn7HbYYZmub5f0sACjLQOSMpFGcQBZIvVAtMfMXJj1zwuCz2PRPx5k7v2y VgacnpCxPheelUwF6gO9ppFsTvu9LqEhNbOgRbTWiFRmbYbd5mLED8M7ez4O6xBWP5CI uLww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2Dl719vf+4e7ak89dH3QgvfFZRLc4oDS4GdFH0txpAw=; fh=xqfGstDbu7aCFWLxVuN6wPNU466mOcXy68bYoEYguJc=; b=FqG2R4kv2ymrIeVhgBo4SHJfoUQmGUNBhoI6oIJkrdvhgm/k6W0AgcH4qabN/2t6p0 ozaXxwH43DFuksdOJgO/tVliv3bgI6WXs8qAaQrw9DPqlyiZ5OqRohJmBxb5LXb3iGUu mW3LmInBLePUX9xjwdiDzJlPHLfkewtS4ejWayuvO5iVFSQ01MgMuuP3WFOLNomSUvQg 3vwl9dy/klOlB/aPquBoAl7R5GBdQTWPFK8K9rk/w6lQs7V9eBG60cx4NjRI+Z/B3uB8 j/qJT20tDWwpzo/aUyj5fqK/zdOHrZVWEP9VdsrYlqdA+sHkcWsjmsCXisNPlby5SMvu t1Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o1Bi6Yza; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id vr15-20020a05620a55af00b007839620da5fsi4735417qkn.521.2024.01.22.08.37.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2024 08:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o1Bi6Yza; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRxHw-0004Cz-6H; Mon, 22 Jan 2024 11:36:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRxHW-00048f-Ga for qemu-devel@nongnu.org; Mon, 22 Jan 2024 11:36:20 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRxHR-0001hU-2U for qemu-devel@nongnu.org; Mon, 22 Jan 2024 11:36:15 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-339261a6ec2so1955521f8f.0 for ; Mon, 22 Jan 2024 08:36:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705941370; x=1706546170; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2Dl719vf+4e7ak89dH3QgvfFZRLc4oDS4GdFH0txpAw=; b=o1Bi6Yza62OnhVNOELHw0dAVYgrZLboieoBk17ZSOK/mU6eCCJe2LN07plf07C8L3x VNfId6IEz08aL65fdt/oDdBvyERAib2LijjXcHANjWTqEA6oSEqcDIjXO3VOfkNX1qwB zB83WaaXKxm4hRRV2qjxjxSWZroEtmsy/A6RkKHjFPbo8hsTkZRYpQjzGdJ+igUlhTRT NfpVJiVHFUkVV/+9D/Ep9F+yGGA+Sd75diaHSIM93i5FJ1hbFdCAdM91fmvd5+bsGEgT tXVKhCQmP98uyey555x+97hAu7OU59XpDl83X5hyPjZYr2vRjq0n+uJpPFfEe2k7fuxO /UVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705941370; x=1706546170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Dl719vf+4e7ak89dH3QgvfFZRLc4oDS4GdFH0txpAw=; b=XT6gQ87rcQGW6zBvSGfCrTm8N2jwujj5bohkVqorK7Ni9OPlMMrQAr3WrYr+YPYHIp DrrbYYI90stX0KuOxTQZ6h60BeU56ilzr8/Sh/LE2/CTBGnCUA31a80KfWxTvttiIMvv q/gBEcBK9u2v4Jx+9xxOAbQijnOEpRZrGKAbRps90gFD+MjumCrTkVReFv5l1iUkq2tZ sZ1ixbnSihpnCi8sf/JXfe40ZjBNGtq96bpJB91MuI5hqH/UoJgPC5hhqErwlHMjAaU7 ntIJD/taL92zcbirYherhRpzzMxpG13QRbsNGicS3oRFFdkIWgCDTrjSewLZaqshagSe mZbA== X-Gm-Message-State: AOJu0Yy2y4sWvEqpWYzdLw6+fKQ5miQzddeClcxG8XfmsrOVRb5WKKZH wwT8B7gJxstDtl58JJQ5rIU3hVEu6gLH+4VcSVgiM7/yBn18ZgeIjogooqpjeP9M+nAXSntkL66 H X-Received: by 2002:a05:6000:dcf:b0:337:c5fb:c851 with SMTP id dw15-20020a0560000dcf00b00337c5fbc851mr2892718wrb.8.1705941370485; Mon, 22 Jan 2024 08:36:10 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e15-20020a5d530f000000b003391720fa51sm9188728wrv.60.2024.01.22.08.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 08:36:10 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Bohdan Kostiv , Markus Armbruster , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PATCH 2/2] qemu-options.hx: Improve -serial option documentation Date: Mon, 22 Jan 2024 16:36:07 +0000 Message-Id: <20240122163607.459769-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240122163607.459769-1-peter.maydell@linaro.org> References: <20240122163607.459769-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The -serial option documentation is a bit brief about '-serial none' and '-serial null'. In particular it's not very clear about the difference between them, and it doesn't mention that it's up to the machine model whether '-serial none' means "don't create the serial port" or "don't wire the serial port up to anything". Expand on these points. Signed-off-by: Peter Maydell Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé --- qemu-options.hx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index ced82848637..d8c3fe91de1 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4129,7 +4129,8 @@ SRST This option can be used several times to simulate up to 4 serial ports. - Use ``-serial none`` to disable all serial ports. + You can use ``-serial none`` to suppress the creation of default + serial devices. Available character devices are: @@ -4151,10 +4152,17 @@ SRST [Linux only] Pseudo TTY (a new PTY is automatically allocated) ``none`` - No device is allocated. + No device is allocated. Note that for machine types which + emulate systems where a serial device is always present in + real hardware, this may be equivalent to the ``null`` option, + in that the serial device is still present but all output + is discarded. For boards where the number of serial ports is + truly variable, this suppresses the creation of the device. ``null`` - void device + A guest will see the UART or serial device as present in the + machine, but all output is discarded, and there is no input. + Conceptually equivalent to redirecting the output to ``/dev/null``. ``chardev:id`` Use a named character device defined with the ``-chardev``