[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 15/16] python/qemu/machine: Allow to use other serial consoles
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 15/16] python/qemu/machine: Allow to use other serial consoles than default |
Date: |
Sun, 20 Oct 2019 01:47:14 +0200 |
Currently the QEMU Python module limits the QEMUMachine class to
use the first serial console.
Some machines/guest might use another console than the first one as
the 'boot console'. For example the Raspberry Pi uses the second
(AUX) console.
To be able to use the Nth 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é <address@hidden>
---
v2:
- renamed 'console_index', added docstring (Cleber)
- reworded description (pm215)
---
python/qemu/machine.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 128a3d1dc2..6fa68fa35a 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_index):
+ args.extend(['-serial', 'null'])
if self._console_set:
self._console_address = os.path.join(self._temp_dir,
self._name + "-console.sock")
@@ -495,7 +497,7 @@ class QEMUMachine(object):
"""
self._machine = machine_type
- def set_console(self, device_type=None):
+ def set_console(self, device_type=None, console_index=0):
"""
Sets the device type for a console device
@@ -516,9 +518,14 @@ class QEMUMachine(object):
chardev:console" command line argument will
be used instead, resorting to the machine's
default device type.
+ @param console_index: the index of the console device to use.
+ If not zero, the command line will create
+ 'index - 1' consoles and connect them to
+ the 'null' backing character device.
"""
self._console_set = True
self._console_device_type = device_type
+ self._console_index = console_index
@property
def console_socket(self):
--
2.21.0
- [PATCH v3 07/16] hw/arm/bcm2836: Use per CPU address spaces, (continued)
- [PATCH v3 07/16] hw/arm/bcm2836: Use per CPU address spaces, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v3 09/16] hw/arm/bcm2836: Create VideoCore address space in the SoC, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v3 10/16] hw/arm/raspi: Use AddressSpace when using arm_boot::write_secondary_boot, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v3 11/16] hw/arm/raspi: Use -smp cores=<N> option to restrict enabled cores, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v3 12/16] hw/arm/bcm2836: Rename enabled_cpus -> enabled_cores, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v3 13/16] hw/arm/raspi: Make the board code modular, Philippe Mathieu-Daudé, 2019/10/19
- [PATCH v3 15/16] python/qemu/machine: Allow to use other serial consoles than default,
Philippe Mathieu-Daudé <=
- [PATCH v3 14/16] hw/arm/highbank: Use AddressSpace when using write_secondary_boot(), Philippe Mathieu-Daudé, 2019/10/19
- [PATCH NOTFORMERGE v3 16/16] tests/acceptance: Test U-boot on the Raspberry Pi 3, Philippe Mathieu-Daudé, 2019/10/19
- Re: [PATCH v3 00/16] hw/arm/raspi: Add thermal/timer, improve address space, run U-boot, Peter Maydell, 2019/10/24
- Re: [PATCH v3 00/16] hw/arm/raspi: Add thermal/timer, improve address space, run U-boot, Peter Maydell, 2019/10/24