misc: configurator: Add entry "None" to HV console selector

Add an explicit "None" entry in HV console selector if user would like
to disable debug console or there is no serial console available.

Tracked-On: #7546
Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
This commit is contained in:
Calvin Zhang 2022-05-23 17:29:54 +08:00 committed by acrnsi-robot
parent 579e5247fb
commit 17d8eaa7ae
3 changed files with 6 additions and 12 deletions

View File

@ -23,9 +23,9 @@
These settings can only be changed at build time.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SERIAL_CONSOLE" type="SerialConsoleOptions">
<xs:element name="SERIAL_CONSOLE" type="SerialConsoleType" default="None">
<xs:annotation acrn:title="Serial console port" acrn:views="basic"
acrn:options="//ttys/serial[type != '0']/dev_path/text()">
acrn:options="//ttys/serial[type != '0']/dev_path/text(), 'None' ">
<xs:documentation>Select the host serial device used for hypervisor debugging.</xs:documentation>
</xs:annotation>
</xs:element>

View File

@ -172,17 +172,10 @@ Read more about the available scheduling options in :ref:`cpu_sharing`.</xs:docu
<xs:simpleType name="SerialConsoleType">
<xs:restriction base="xs:string">
<xs:pattern value=".*ttyS[\d]+" />
<xs:pattern value="(.*ttyS[\d]+)|None" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SerialConsoleOptions">
<xs:annotation>
<xs:documentation>Either empty or a string, such as ``/dev/ttyS0``.</xs:documentation>
</xs:annotation>
<xs:union memberTypes="None SerialConsoleType" />
</xs:simpleType>
<xs:simpleType name="VMNameType">
<xs:annotation acrn:widget-options="'placeholder': 'A string with at most 15 non-space characters, e.g. Linux-VM-1.'">
<xs:documentation>A string of up to 15 letters, digits, ``_``, or ``-``.</xs:documentation>

View File

@ -53,15 +53,16 @@ class BusDevFunc(namedtuple(
def parse_hv_console(scenario_etree):
"""
There may be 3 types in the console item
There may be 4 types in the console item
1. BDF:(00:18.2) seri:/dev/ttyS2
2. /dev/ttyS2
3. ttyS2
4. "None"
"""
ttys_n = ''
ttys = common.get_node("//SERIAL_CONSOLE/text()", scenario_etree)
if not ttys or ttys == None:
if not ttys or ttys == None or ttys == 'None':
return ttys_n
if ttys and 'BDF' in ttys or '/dev' in ttys: