From nobody Wed Apr 2 02:15:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1569520777; cv=none; d=zoho.com; s=zohoarc; b=nFmqWVLVRzd1c+fg/j6e27G2KwVMn7n3rN07pi6tPLrRiTFDczJcDWC0rXeKkFFZKjUv4pe0nNqD0A6kJz5huLugBQ/LPnzEw4vKptclLsGL9z3dsJIknxnvzyzSBgS+CAdX6Sta+Es9LMsHy5gtwBZz7UIIT2nWkYLFxPa0Ttg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569520777; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=cygAIn+NuvbvRK0dqFc+XGYOmNQ092Yut2eORQ2IB/E=; b=Kx4ignZWrhqXuDy5t1eMYN1uT2K97137RRuRbaSeDxEFhpAwZymu7nUkFmibtUajc4CUbC5DJEufECKnTShcQKxDWh/xVnanSO8R336Lfks4EQm0YxIqtgwW651IQRxsNnvLIBGmSNCFfR90FkxSgxozgmRfuqqM8GT+v0jOGp4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569520777915107.52563037396635; Thu, 26 Sep 2019 10:59:37 -0700 (PDT) Received: from localhost ([::1]:41956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDY3B-0000h9-VZ for importer@patchew.org; Thu, 26 Sep 2019 13:59:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59084) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDXgT-0004jm-Mp for qemu-devel@nongnu.org; Thu, 26 Sep 2019 13:36:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDXgS-00035k-Fv for qemu-devel@nongnu.org; Thu, 26 Sep 2019 13:36:05 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35069) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDXgS-00034b-9i; Thu, 26 Sep 2019 13:36:04 -0400 Received: by mail-wr1-f65.google.com with SMTP id v8so3736777wrt.2; Thu, 26 Sep 2019 10:36:04 -0700 (PDT) Received: from x1w.redhat.com (240.red-88-21-68.staticip.rima-tde.net. [88.21.68.240]) by smtp.gmail.com with ESMTPSA id b186sm9918980wmd.16.2019.09.26.10.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 10:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cygAIn+NuvbvRK0dqFc+XGYOmNQ092Yut2eORQ2IB/E=; b=GQIbIbV9fySy4FLDxvt+JEgMFNVpmd1ccC7GT6b21MZWKp4WbYw20LIM7pgz0NVE+y hlTlUlr0k2tdGuiUbFoh8MopOPLEOyWysoq8tmL1AipVsVRm5HU2DP3orh4HgR2sLr6a J5uR6z7mE5gYiobYBpWg/0Slz6nrF0L2Pp2egTsd/sbvz8pGpp8kuOEam5MhBuDCestT lpAobfjhz8b7WqlUHZrJ/qA5SiQhHONtAcFPLjKRdJ2OMygky/dcts4VuOIFe/VhXWvJ QOhiz/B2dYU2VpPQWcsLiJWQrFCmpjXDExwu41ZDmhNQwIU6tiyoLoROSZ35ctFG2ABt 2ifQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cygAIn+NuvbvRK0dqFc+XGYOmNQ092Yut2eORQ2IB/E=; b=YcNtuW7nITuqYCG8Gvx65ZXF67GZ78InlfS2IXYe9mdLgzxXjxgJGHqA7ehZzbm6zK oAWB9cfo3MLZcI6TWzeChrfLTAiDoLOPZIHc/nk/FSQHFYk0SM5jDdn+kiX1zD6bXhEr VYBHuFeXPA9S7q2PL4wbyWBGQCBJbrM98B8zn04MlzFqEnjjaNI3L4iyx+7Wud9Y2mDt KPyIgkDclstVnMHDQ7uOWeqLRXL6130f1VB23wXQsaot3iG9pIcEYEC/QdA9jvBqwXhg l0Gfye+YC2A3sLtlY7t/784m+LybXyuUZ72lauLes78KZBJ+oIVJa/Z1INOtkUgLG9d1 TsRg== X-Gm-Message-State: APjAAAVY648nTZ3fuHYfHhb0/e/hhl0KYIKNamayY+6f7Hm6ewljqooR JhWZggrji8d9gLygXuKAzi7F306HbJM= X-Google-Smtp-Source: APXvYqzKi+l8hJ0ZwKsilohSPe/nN9WplkNcPd4ZcY6UM2Vrtfg+PZHV40/XD+YRCAWHC/THRa/S4A== X-Received: by 2002:adf:f212:: with SMTP id p18mr4215158wro.340.1569519303075; Thu, 26 Sep 2019 10:35:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 14/19] python/qemu/machine: Allow to use other serial consoles than default Date: Thu, 26 Sep 2019 19:34:22 +0200 Message-Id: <20190926173428.10713-15-f4bug@amsat.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190926173428.10713-1-f4bug@amsat.org> References: <20190926173428.10713-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.65 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?UTF-8?q?Zolt=C3=A1n=20Baldaszti?= , Laurent Bonnans , Esteban Bosse , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Baumann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-arm@nongnu.org, Clement Deschamps , Cleber Rosa , Paolo Bonzini , Cheng Xiang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pekka Enberg , Guenter Roeck , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Currently we are limited to use the first serial console available. Some machines/guest might use another console than the first one as the 'boot console'. To be able to use the N console as default, we simply need to connect all the N - 1 consoles to the null chardev. Add an index argument, so we can use a specific serial console as default. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- python/qemu/machine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 128a3d1dc2..302b158a18 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -235,6 +235,8 @@ class QEMUMachine(object): '-display', 'none', '-vga', 'none'] if self._machine is not None: args.extend(['-machine', self._machine]) + for i in range(self._console_id): + args.extend(['-serial', 'null']) if self._console_set: self._console_address =3D os.path.join(self._temp_dir, self._name + "-console.so= ck") @@ -495,7 +497,7 @@ class QEMUMachine(object): """ self._machine =3D machine_type =20 - def set_console(self, device_type=3DNone): + def set_console(self, device_type=3DNone, console_id=3D0): """ Sets the device type for a console device =20 @@ -519,6 +521,7 @@ class QEMUMachine(object): """ self._console_set =3D True self._console_device_type =3D device_type + self._console_id =3D console_id =20 @property def console_socket(self): --=20 2.20.1