From patchwork Fri Apr 20 14:52:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 133885 Delivered-To: patches@linaro.org Received: by 10.46.66.142 with SMTP id h14csp374944ljf; Fri, 20 Apr 2018 07:52:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/RdG9SMUTzKfKVaGz5QlX4D+uH3uxHV36a7Mm1BnzJ/tgUb4yMt7fzPoyLKcJYrPnJrYIK X-Received: by 10.99.123.17 with SMTP id w17mr8815236pgc.8.1524235976261; Fri, 20 Apr 2018 07:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524235976; cv=none; d=google.com; s=arc-20160816; b=kSrKcvvsbjNHLd5nRECGLOQ0egNGxr02oZ5kszwCDqxwh3hYFcY+Ul9ZxM387rnyhM dRINTmqLPeiksJnOXx2ewzy8ni8zRxxZUCPYlpbSYuL53C8FEObKGT7Hr2qxQBSKT7QH unfaBEGHrj32K64jow/496MQbAiNLrHcAFU6hRbmpi9Kme/Enl1VaggwbtkP9C+Pg9N8 X56Gdrr822IeK/uRd3qftVeEXlY4hLxqoefvO3ACA/eAUiiXVPl7Zc1gOgU83srpEO5f GBqxK043rbXex+qBa+rnXlH1xOV1TVbLVQPz03/zowVmIbHXKpfFHRGRGGSsXD7Z2nNn 0l+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XS3ZbZ5fXJhiAxoSXAgmEV7xB2CzzELM5CAm4wwllGM=; b=OKs2BEMKte97x2LCIyF27HX5cTKwkrz514YlzdLObtOkw5dX8HFQ6uK/y0wt5vMijD UEka2hQBaalQYGcDspaxso+88duHO4NO+VOEUegQDN6YmCPgp+2ohMEwT8GicXLTr3Nh aKT3sckdWOZSzGlB2WKiIUDO/a9rVc7rVloVceenw8qQ6HYLy4dJGri8CNSYH1LigMfH X5zUbvseNo/KXFOWa0u2XG7fwhP068nKGoSvQDMRLjf/GZqfJet5VN8c0oVD//mKawa0 hbc6lJ7Y9HTWEXwJs3Y5hFd9rs/L+joXBS0weS38cr7Eklv8N9/Uwa9Otq+tlvwRV8MK zFmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id 1-v6si5677386plz.279.2018.04.20.07.52.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Apr 2018 07:52:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1f9XP8-0006Wz-Q8; Fri, 20 Apr 2018 15:52:50 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Michael S . Tsirkin" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PATCH 01/13] hw/char/serial: Allow disconnected chardevs Date: Fri, 20 Apr 2018 15:52:37 +0100 Message-Id: <20180420145249.32435-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180420145249.32435-1-peter.maydell@linaro.org> References: <20180420145249.32435-1-peter.maydell@linaro.org> Currently the serial.c realize code has an explicit check that it is not connected to a disconnected backend (ie one with a NULL chardev). This isn't what we want -- you should be able to create a serial device even if it isn't attached to anything. Remove the check. Signed-off-by: Peter Maydell --- hw/char/serial.c | 5 ----- 1 file changed, 5 deletions(-) -- 2.17.0 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Thomas Huth diff --git a/hw/char/serial.c b/hw/char/serial.c index eb72191ee7..2c080c9862 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -923,11 +923,6 @@ static int serial_be_change(void *opaque) void serial_realize_core(SerialState *s, Error **errp) { - if (!qemu_chr_fe_backend_connected(&s->chr)) { - error_setg(errp, "Can't create serial device, empty char device"); - return; - } - s->modem_status_poll = timer_new_ns(QEMU_CLOCK_VIRTUAL, (QEMUTimerCB *) serial_update_msl, s); s->fifo_timeout_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, (QEMUTimerCB *) fifo_timeout_int, s);