Date   

[PATCH] config_tools: pretty-print JSON schema violations

Junjie Mao
 

The default error messages provided by the ajv validation library read like
this:

* must have required property MEMORY.STACK_SIZE

* must match pattern "<a regular expression>"

Such messages may look confusing as users are not supposed to understand
the internal naming of the config items or the regular expressions used to
validate strings.

This patch enables the XML schema to include 'acrn:errormsg' annotations
which is a dictionary from error types to customized error messages. This
mechanism is used to show more user-friendly messages upon common errors
such as missing or invalid data in required config item.

Tracked-On: #6691
Signed-off-by: Junjie Mao <junjie.mao@...>
---
.../scenario_config/jsonschema/converter.py | 19 +++++++++++++++++--
misc/config_tools/schema/VMtypes.xsd | 15 ++++++++++-----
misc/config_tools/schema/config.xsd | 15 +++++++++------
misc/config_tools/schema/types.xsd | 6 ++++--
4 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/misc/config_tools/scenario_config/jsonschema/converter.py b/misc/config_tools/scenario_config/jsonschema/converter.py
index 086aed148..8274c1bf0 100644
--- a/misc/config_tools/scenario_config/jsonschema/converter.py
+++ b/misc/config_tools/scenario_config/jsonschema/converter.py
@@ -151,6 +151,17 @@ class XS2JS:
if '@acrn:widget-options' in annotation:
js_ele['ui:options'] = eval(f"{{{annotation['@acrn:widget-options']}}}")

+ def convert_errormsg_config(self, annotation, js_ele):
+ if '@acrn:errormsg' in annotation:
+ opts = eval(f"{{{annotation['@acrn:errormsg']}}}")
+
+ # An items of an error schema requires an "err:" prefix.
+ keys = list(opts.keys())
+ for key in keys:
+ opts[f"err:{key}"] = opts.pop(key)
+
+ js_ele.update(opts)
+
def xst2jst(self, type_name) -> str:
"""convert xml schema type name to json schema type name"""
if type_name in self.xst2jst_mapping:
@@ -195,9 +206,10 @@ class XS2JS:
enum_names.append(enum_name)
js_st["enumNames"] = enum_names

- # widget and its options
+ # widget configs and error messages
if 'xs:annotation' in obj:
self.convert_widget_config(obj['xs:annotation'], js_st)
+ self.convert_errormsg_config(obj['xs:annotation'], js_st)

js_st.update(self.xsa2jsa(restriction))
return js_st
@@ -298,7 +310,7 @@ class XS2JS:

if '@maxOccurs' in element:
# ui:options seen at this moment are copied from the annotation of the type.
- possible_keys = ['type', '$ref', 'oneOf', 'ui:options']
+ possible_keys = ['type', '$ref', 'oneOf', 'ui:options', 'err:required', 'err:pattern']
convert_to_items_success = False
js_ele['items'] = {}
for possible_key in possible_keys:
@@ -353,6 +365,9 @@ class XS2JS:
# widget and its options
self.convert_widget_config(element['xs:annotation'], js_ele)

+ # Error messages
+ self.convert_errormsg_config(element['xs:annotation'], js_ele)
+
properties[name] = js_ele

# build result
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..850db0d91 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -88,12 +88,14 @@ CLOSID 0 and the second is mapped to virtual CLOSID 1, etc.</xs:documentation>
<xs:complexType name="EPCSection">
<xs:sequence>
<xs:element name="base" type="HexFormat" default="0">
- <xs:annotation acrn:title="EPC section base" acrn:applicable-vms="pre-launched">
+ <xs:annotation acrn:title="EPC section base" acrn:applicable-vms="pre-launched"
+ acrn:errormsg="'required': 'EPC section base is required.'">
<xs:documentation>Specify the enclave page cache (EPC) section base for Intel Software Guard Extensions (SGX). Must be page aligned.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="size" type="HexFormat" default="0">
- <xs:annotation acrn:title="EPC section size (bytes)" acrn:applicable-vms="pre-launched">
+ <xs:annotation acrn:title="EPC section size (bytes)" acrn:applicable-vms="pre-launched"
+ acrn:errormsg="'required': 'EPC section size is required.'">
<xs:documentation>Specify the enclave page cache (EPC) section size in bytes for Intel Software Guard Extensions (SGX). Must be page aligned.</xs:documentation>
</xs:annotation>
</xs:element>
@@ -103,12 +105,14 @@ CLOSID 0 and the second is mapped to virtual CLOSID 1, etc.</xs:documentation>
<xs:complexType name="HPARegionType">
<xs:sequence>
<xs:element name="start_hpa" type="HexFormat">
- <xs:annotation acrn:title="Start physical address">
+ <xs:annotation acrn:title="Start physical address"
+ acrn:errormsg="'required': 'Physical memory base address is required.'">
<xs:documentation>Specify the starting address for non-contiguous allocation.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="size_hpa" type="xs:integer">
- <xs:annotation acrn:title="Size (MB)">
+ <xs:annotation acrn:title="Size (MB)"
+ acrn:errormsg="'required': 'Physical memory size is required.'">
<xs:documentation>Specify the physical memory size for non-contiguous allocation in megabytes.
The size is a subset of the VM's total memory size specified on the Basic tab.</xs:documentation>
</xs:annotation>
@@ -290,7 +294,8 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:sequence>
<xs:element name="usb_dev" type="xs:string" minOccurs="0" maxOccurs="unbounded">
<xs:annotation acrn:title="USB device assignment"
- acrn:options="//usb_device/@description" acrn:options-sorted-by="lambda s: s">
+ acrn:options="//usb_device/@description" acrn:options-sorted-by="lambda s: s"
+ acrn:errormsg="'required': 'USB device required. If no USB device is available, click the X at the top right corner of this entry to remove.'">
<xs:documentation>Select the USB devices you want to assign to this virtual machine.</xs:documentation>
</xs:annotation>
</xs:element>
diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index b99198982..d5e6ba3df 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -134,7 +134,8 @@ These settings can only be changed at build time.</xs:documentation>
<xs:complexType name="MemoryOptionsType">
<xs:all>
<xs:element name="STACK_SIZE" type="HexFormat" default="0x2000">
- <xs:annotation acrn:title="CPU memory stack size (bytes)" acrn:views="advanced">
+ <xs:annotation acrn:title="CPU memory stack size (bytes)" acrn:views="advanced"
+ acrn:errormsg="'required': 'Stack size is required.'">
<xs:documentation>Specify the size of the memory stack in bytes for each physical CPU. For example, if you specify 8 kilobytes, each CPU will get its own 8-kilobyte stack.</xs:documentation>
</xs:annotation>
</xs:element>
@@ -302,9 +303,10 @@ Refer to :ref:`vuart_config` for detailed vUART settings.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="name" type="VMNameType">
- <xs:annotation acrn:title="VM name" acrn:views="basic">
- <xs:documentation>Specify the name used to identify this VM. The VM name will be shown in the hypervisor console vm_list command.</xs:documentation>
- </xs:annotation>
+ <xs:annotation acrn:title="VM name" acrn:views="basic"
+ acrn:errormsg="'required': 'VM name is required.'">
+ <xs:documentation>Specify the name used to identify this VM. The VM name will be shown in the hypervisor console vm_list command.</xs:documentation>
+ </xs:annotation>
</xs:element>
<xs:element name="vm_type" type="VMType" minOccurs="0">
<xs:annotation acrn:title="VM type" acrn:views="basic">
@@ -495,8 +497,9 @@ mouse, and tablet. It sends Linux input layer events over virtio.</xs:documenta
<xs:documentation>The virtio-blk device presents a block device to the VM. Each virtio-blk device appears as a disk inside the VM.</xs:documentation>
</xs:annotation>
<xs:simpleType>
- <xs:annotation acrn:widget-options="'placeholder': '/home/user/path/to/disk.image'" />
- <xs:restriction base="xs:string" />
+ <xs:annotation acrn:widget-options="'placeholder': '/home/user/path/to/disk.image'"
+ acrn:errormsg="'required': 'Path to a disk image required.'"/>
+ <xs:restriction base="xs:string" />
</xs:simpleType>
</xs:element>
</xs:all>
diff --git a/misc/config_tools/schema/types.xsd b/misc/config_tools/schema/types.xsd
index a637654dc..8450fffae 100644
--- a/misc/config_tools/schema/types.xsd
+++ b/misc/config_tools/schema/types.xsd
@@ -24,7 +24,8 @@
</xs:simpleType>

<xs:simpleType name="HexFormat">
- <xs:annotation acrn:widget-options="'placeholder': 'A hexadecimal number with a leading 0x, e.g. 0x1000.'">
+ <xs:annotation acrn:widget-options="'placeholder': 'A hexadecimal number with a leading 0x, e.g. 0x1000.'"
+ acrn:errormsg="'pattern': 'Must be a hexadecimal integer (case-insensitive).'">
<xs:documentation>An Integer value in hexadecimal format (with a leading ``0x``).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
@@ -177,7 +178,8 @@ Read more about the available scheduling options in :ref:`cpu_sharing`.</xs:docu
</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:annotation acrn:widget-options="'placeholder': 'A string with at most 15 non-space characters, e.g. Linux-VM-1.'"
+ acrn:errormsg="'pattern': 'Must NOT be longer than 15 characters or contain characters other than letters, digits, \'_\' and \'-\'.'">
<xs:documentation>A string of up to 15 letters, digits, ``_``, or ``-``.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
--
2.30.2


Re: [PATCH] config_tools: hide "PCI" option for Console virtual UART type

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

It's unexpected to show the "PCI" option for Console virtual UART type
currently, so this patch hide it in configurator.

Tracked-On: #7592
Signed-off-by: Kunhui-Li <kunhuix.li@...>
Reviewed-by: Junjie Mao <junjie.mao@...>

--
Best Regards
Junjie Mao

---
misc/config_tools/schema/VMtypes.xsd | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index 73699c824..70d67a290 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -201,7 +201,9 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:enumeration value="COM Port 2" />
<xs:enumeration value="COM Port 3" />
<xs:enumeration value="COM Port 4" />
- <xs:enumeration value="PCI" />
+ <xs:enumeration value="PCI" >
+ <xs:annotation acrn:views="" />
+ </xs:enumeration>
</xs:restriction>
</xs:simpleType>


Re: [PATCH] config_tools: bugfix for saving all enum values

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

fix the issue that all enum values are saved in scenario xml file
if user doesn't select any value in configurator.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@...>
I'm fine with this change. How about the other customized widgets?

--
Best Regards
Junjie Mao

---
.../pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index 49f7b73d7..f2d88444e 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -137,8 +137,8 @@ export default {
this.defaultVal = []
}
this.defaultVal.push({
- "use_type": this.ConsoleUseType,
- "backend_type": this.ConsoleBackendType,
+ "use_type": "",
+ "backend_type": "",
"output_file_path": "",
"sock_file_path": "",
"tty_device_path": "",


Re: [PATCH v4] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)

v3-->v4:
for customed widgets, virtio console, add function to support that using enum titles to
show more user-friendly names in the configurator, and the enum value filled
in json data.

v2-->v3:
use enum titles to show more user-friendly names in the configurator

v1->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
Reviewed-by: Junjie Mao <junjie.mao@...>

---
.../ConfigForm/CustomWidget/Virtio/Console.vue | 17 ++++++++++++++---
misc/config_tools/schema/VMtypes.xsd | 8 ++++++--
2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index f75ff9bc0..49f7b73d7 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -8,7 +8,7 @@
<label>Use type: </label>
</b-col>
<b-col md="4">
- <b-form-select v-model="console.use_type" :options="ConsoleUseType"/>
+ <b-form-select v-model="console.use_type" :options="getUseTypes"/>
</b-col>
</b-row>

@@ -95,7 +95,8 @@ export default {
},
data() {
return {
- ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
+ enumNames: this.rootSchema.definitions['VirtioConsoleUseType']['enumNames'],
+ enum: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
@@ -117,6 +118,16 @@ export default {
deep: true
}
},
+ computed: {
+ getUseTypes() {
+ let enumOptions = []
+ for (let i = 0; i < this.enumNames.length; i++) {
+ let enumOption = {text: this.enumNames[i], value: this.enum[i]}
+ enumOptions.push(enumOption)
+ }
+ return enumOptions
+ },
+ },
methods: {
removeVirtioConsole(index) {
this.defaultVal.splice(index, 1);
@@ -165,4 +176,4 @@ export default {
border-radius: 5px;
margin-bottom: 1rem;
}
-</style>
\ No newline at end of file
+</style>
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..73699c824 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -336,8 +336,12 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="Virtio console" >
+ <xs:annotation acrn:title="virtio serial port (as console)" />
+ </xs:enumeration>
+ <xs:enumeration value="Virtio serial port" >
+ <xs:annotation acrn:title="virtio serial port" />
+ </xs:enumeration>
</xs:restriction>
</xs:simpleType>
--
Best Regards
Junjie Mao


[PATCH] config_tools: hide "PCI" option for Console virtual UART type

Kunhui Li
 

It's unexpected to show the "PCI" option for Console virtual UART type
currently, so this patch hide it in configurator.

Tracked-On: #7592
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
misc/config_tools/schema/VMtypes.xsd | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index 73699c824..70d67a290 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -201,7 +201,9 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:enumeration value="COM Port 2" />
<xs:enumeration value="COM Port 3" />
<xs:enumeration value="COM Port 4" />
- <xs:enumeration value="PCI" />
+ <xs:enumeration value="PCI" >
+ <xs:annotation acrn:views="" />
+ </xs:enumeration>
</xs:restriction>
</xs:simpleType>

--
2.25.1


[PATCH] config_tools: bugfix for saving all enum values

Kunhui Li
 

fix the issue that all enum values are saved in scenario xml file
if user doesn't select any value in configurator.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index 49f7b73d7..f2d88444e 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -137,8 +137,8 @@ export default {
this.defaultVal = []
}
this.defaultVal.push({
- "use_type": this.ConsoleUseType,
- "backend_type": this.ConsoleBackendType,
+ "use_type": "",
+ "backend_type": "",
"output_file_path": "",
"sock_file_path": "",
"tty_device_path": "",
--
2.25.1


[PATCH v4] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Kunhui Li
 

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)

v3-->v4:
for customed widgets, virtio console, add function to support that using enum titles to
show more user-friendly names in the configurator, and the enum value filled
in json data.

v2-->v3:
use enum titles to show more user-friendly names in the configurator

v1->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../ConfigForm/CustomWidget/Virtio/Console.vue | 17 ++++++++++++++---
misc/config_tools/schema/VMtypes.xsd | 8 ++++++--
2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index f75ff9bc0..49f7b73d7 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -8,7 +8,7 @@
<label>Use type: </label>
</b-col>
<b-col md="4">
- <b-form-select v-model="console.use_type" :options="ConsoleUseType"/>
+ <b-form-select v-model="console.use_type" :options="getUseTypes"/>
</b-col>
</b-row>

@@ -95,7 +95,8 @@ export default {
},
data() {
return {
- ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
+ enumNames: this.rootSchema.definitions['VirtioConsoleUseType']['enumNames'],
+ enum: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
@@ -117,6 +118,16 @@ export default {
deep: true
}
},
+ computed: {
+ getUseTypes() {
+ let enumOptions = []
+ for (let i = 0; i < this.enumNames.length; i++) {
+ let enumOption = {text: this.enumNames[i], value: this.enum[i]}
+ enumOptions.push(enumOption)
+ }
+ return enumOptions
+ },
+ },
methods: {
removeVirtioConsole(index) {
this.defaultVal.splice(index, 1);
@@ -165,4 +176,4 @@ export default {
border-radius: 5px;
margin-bottom: 1rem;
}
-</style>
\ No newline at end of file
+</style>
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..73699c824 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -336,8 +336,12 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="Virtio console" >
+ <xs:annotation acrn:title="virtio serial port (as console)" />
+ </xs:enumeration>
+ <xs:enumeration value="Virtio serial port" >
+ <xs:annotation acrn:title="virtio serial port" />
+ </xs:enumeration>
</xs:restriction>
</xs:simpleType>

--
2.25.1


[PATCH] config_tools: fix move_enablement in the upgrader

Junjie Mao
 

The EnablementType is now obsolete and config items having this type have
been updated to use the Boolean type. However, the upgrader is not changed
accordingly and it still converts "y" or "n" of certain config items to
"Enable" or "Disable".

This patch drops the EnablementType in the schema and updates the upgrader
to respect the latest definitions.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@...>
---
misc/config_tools/scenario_config/upgrader.py | 6 +++---
misc/config_tools/schema/types.xsd | 10 ----------
2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/misc/config_tools/scenario_config/upgrader.py b/misc/config_tools/scenario_config/upgrader.py
index ae28cb446..50a4422f5 100755
--- a/misc/config_tools/scenario_config/upgrader.py
+++ b/misc/config_tools/scenario_config/upgrader.py
@@ -594,13 +594,13 @@ class ScenarioUpgrader(ScenarioTransformer):

return False

- def move_enablement(self, xpath, xsd_element_node, xml_parent_node, new_nodes, values_as_enabled = ["y"], values_as_disabled = ["n"]):
+ def move_enablement(self, xpath, xsd_element_node, xml_parent_node, new_nodes, values_as_enabled = ["Enable"], values_as_disabled = ["Disable"]):
ret = self.move_data_by_xpath(xpath, xsd_element_node, xml_parent_node, new_nodes)
for n in new_nodes:
if n.text in values_as_enabled:
- n.text = "Enable"
+ n.text = "y"
elif n.text in values_as_disabled:
- n.text = "Disable"
+ n.text = "n"
return ret

def move_data_by_xpath(self, xpath, xsd_element_node, xml_parent_node, new_nodes, scenario_xml_only = False, launch_xml_only = False):
diff --git a/misc/config_tools/schema/types.xsd b/misc/config_tools/schema/types.xsd
index a637654dc..b77e46b43 100644
--- a/misc/config_tools/schema/types.xsd
+++ b/misc/config_tools/schema/types.xsd
@@ -13,16 +13,6 @@
</xs:restriction>
</xs:simpleType>

-<xs:simpleType name="EnablementType">
- <xs:annotation>
- <xs:documentation>A string with value: ``Enable`` or ``Disable``.</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:enumeration value="Enable" />
- <xs:enumeration value="Disable" />
- </xs:restriction>
-</xs:simpleType>
-
<xs:simpleType name="HexFormat">
<xs:annotation acrn:widget-options="'placeholder': 'A hexadecimal number with a leading 0x, e.g. 0x1000.'">
<xs:documentation>An Integer value in hexadecimal format (with a leading ``0x``).</xs:documentation>
--
2.30.2


[PATCH] misc: config_tool: Add udmabuf.list_limit=8192 to ServiceVM bootargs

Calvin Zhang <calvinzhang.cool@...>
 

Add udmabuf.list_limit=8192 to ServiceVM bootargs for virtio gpu. It's
harmless if not used.

Tracked-On: #7581
Signed-off-by: Calvin Zhang <calvinzhang.cool@...>
---
misc/config_tools/xforms/misc_cfg.h.xsl | 1 +
misc/config_tools/xforms/vm_configurations.h.xsl | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/misc/config_tools/xforms/misc_cfg.h.xsl b/misc/config_tools/xforms/misc_cfg.h.xsl
index f3dc0a9ca..f742a78ee 100644
--- a/misc/config_tools/xforms/misc_cfg.h.xsl
+++ b/misc/config_tools/xforms/misc_cfg.h.xsl
@@ -98,6 +98,7 @@
</xsl:variable>
<xsl:value-of select="acrn:define('SERVICE_VM_ROOTFS', concat($quot, $sos_rootfs, ' ', $quot), '')" />
<xsl:value-of select="acrn:define('SERVICE_VM_BOOTARGS_DIFF', concat($quot, $sos_bootargs, ' ', $maxcpus, ' ', $hugepage_kernelstring, ' ', $quot), '')" />
+ <xsl:value-of select="acrn:define('SERVICE_VM_BOOTARGS_MISC', concat($quot, 'udmabuf.list_limit=8192 ', $quot), '')" />
</xsl:template>

<xsl:template name="cpu_affinity">
diff --git a/misc/config_tools/xforms/vm_configurations.h.xsl b/misc/config_tools/xforms/vm_configurations.h.xsl
index 1ef0f3dd2..63fa17220 100644
--- a/misc/config_tools/xforms/vm_configurations.h.xsl
+++ b/misc/config_tools/xforms/vm_configurations.h.xsl
@@ -64,7 +64,7 @@
<xsl:if test="count(vm[load_order='SERVICE_VM'])">
<xsl:value-of select="acrn:comment(concat('SERVICE_VM == VM', vm[load_order='SERVICE_VM']/@id))" />
<xsl:value-of select="$newline" />
- <xsl:value-of select="acrn:define('SERVICE_VM_OS_BOOTARGS', 'SERVICE_VM_ROOTFS SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF', '')" />
+ <xsl:value-of select="acrn:define('SERVICE_VM_OS_BOOTARGS', 'SERVICE_VM_ROOTFS SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF SERVICE_VM_BOOTARGS_MISC', '')" />
</xsl:if>
</xsl:template>

--
2.30.2


Re: [PATCH v3] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Kunhui Li
 

-----Original Message-----
From: Mao, Junjie <junjie.mao@...>
Sent: Tuesday, May 24, 2022 3:30 PM
To: Li, KunhuiX <kunhuix.li@...>
Cc: acrn-dev@...; Xie, Nanlin <nanlin.xie@...>
Subject: Re: [PATCH v3] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Kunhui-Li <kunhuix.li@...> writes:

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)

v2-->v3:
use enum titles to show more user-friendly names in the configurator

v1->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/schema/VMtypes.xsd | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index f75ff9bc0..1de2fecbf 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -95,7 +95,7 @@ export default {
},
data() {
return {
- ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
+ ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enumNames' ],
I'm not familiar with how to specify the values and titles of select
widgets in vue. Please make sure this change does the job properly
(i.e. it only affects the shown names of this select, but does not
impact the data filled in the json object).
Thanks for your kindly reminder.
For customed widgets, for example, VUART, IVSHMEM, and Virtio devices.
If using enum titles to show more user-friendly names in the configurator, it will fill the title name in the XML file. This will lead to some errors.

I will update patch to support this.

--
Best Regards
Junjie Mao

ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..73699c824 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -336,8 +336,12 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="Virtio console" >
+ <xs:annotation acrn:title="virtio serial port (as console)" />
+ </xs:enumeration>
+ <xs:enumeration value="Virtio serial port" >
+ <xs:annotation acrn:title="virtio serial port" />
+ </xs:enumeration>
</xs:restriction>
</xs:simpleType>


[PATCH] misc: modify IVSHMEM virtual BDF validation check

Chenli Wei
 

From: Chenli Wei <chenli.wei@...>

The current UI force user input BDF which could automatically fill it
in if it is blank, so it an optional.

This patch change the BDF to an optional.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@...>
---
.../src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue
index 74874e72d..582712c6a 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue
@@ -51,7 +51,7 @@
</b-form-invalid-feedback>
</b-col>
<b-col sm="3">
- <b-form-input :state="validation(IVSHMEM_VM.VBDF)" v-model="IVSHMEM_VM.VBDF" placeholder="00:[device].[function], e.g. 00:0c.0. All fields are in hexadecimal."/>
+ <b-form-input :v-model="IVSHMEM_VM.VBDF" placeholder="00:[device].[function], e.g. 00:0c.0. All fields are in hexadecimal."/>
<b-form-invalid-feedback>
must have value
</b-form-invalid-feedback>
--
2.25.1


[PATCH] misc: CPU affinity error message cleanup

Chenli Wei
 

From: Chenli Wei <chenli.wei@...>

The current UI display "report on" message, it's not by design, so this
patch remove these message.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@...>
---
.../configurator/packages/configurator/src/pages/Config.vue | 2 +-
misc/config_tools/schema/checks/cpu_assignment.xsd | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue
index deec505bd..629cd5404 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue
@@ -69,7 +69,7 @@
/>
</div>
<div v-if="errors">
- <div class="px-4" style="color: red" v-for="error in errors">{{ error }}</div>
+ <div class="px-4" style="color: red" v-for="error in errors">{{ error.message }}</div>
</div>
<div class="p-4">
<ConfigForm
diff --git a/misc/config_tools/schema/checks/cpu_assignment.xsd b/misc/config_tools/schema/checks/cpu_assignment.xsd
index 430aeaac8..b10669664 100644
--- a/misc/config_tools/schema/checks/cpu_assignment.xsd
+++ b/misc/config_tools/schema/checks/cpu_assignment.xsd
@@ -21,14 +21,14 @@
<xs:assert test="every $pcpu in /acrn-config/vm[load_order = 'PRE_LAUNCHED_VM']//cpu_affinity//pcpu_id satisfies
count(/acrn-config/vm[@id != $pcpu/ancestor::vm//companion_vmid ]//cpu_affinity[.//pcpu_id = $pcpu]) &lt;= 1">
<xs:annotation acrn:severity="error" acrn:report-on="//vm//cpu_affinity[.//pcpu_id = $pcpu]">
- <xs:documentation>Physical CPU {$pcpu} is assigned to Pre-launched VM "{$pcpu/ancestor::vm/name}" and thus cannot be shared among multiple VMs. Look for, and probably remove, any affinity assignments to {$pcpu} in this VM's settings: {//vm[cpu_affinity//pcpu_id = $pcpu]/name}.</xs:documentation>
+ <xs:documentation>Physical CPU {$pcpu} is assigned to Pre-launched VM [{$pcpu/ancestor::vm/name}] and thus cannot be shared among multiple VMs. Look for, and probably remove, any affinity assignments to {$pcpu} in this VM's settings: {//vm[cpu_affinity//pcpu_id = $pcpu]/name}.</xs:documentation>
</xs:annotation>
</xs:assert>

<xs:assert test="every $pcpu in /acrn-config/vm[vm_type = 'RTVM']//cpu_affinity//pcpu_id satisfies
count(/acrn-config/vm[@id != $pcpu/ancestor::vm//companion_vmid ]//cpu_affinity[.//pcpu_id = $pcpu]) &lt;= 1">
<xs:annotation acrn:severity="error" acrn:report-on="//vm//cpu_affinity[.//pcpu_id = $pcpu]">
- <xs:documentation>Physical CPU {$pcpu} is assigned to real-time VM (RTVM) "{$pcpu/ancestor::vm/name}" and thus cannot be shared among multiple VMs. Look for, and probably remove, any affinity assignments to {$pcpu} in this VM's settings: {//vm[cpu_affinity//pcpu_id = $pcpu]/name}.</xs:documentation>
+ <xs:documentation>Physical CPU {$pcpu} is assigned to real-time VM (RTVM) [{$pcpu/ancestor::vm/name}] and thus cannot be shared among multiple VMs. Look for, and probably remove, any affinity assignments to {$pcpu} in this VM's settings: {//vm[cpu_affinity//pcpu_id = $pcpu]/name}.</xs:documentation>
</xs:annotation>
</xs:assert>

--
2.25.1


Re: [PATCH] config_tools: bugfix for the generated launch script without uart parameters

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

bugfix for the generated launch script without uart parameters
after VUART is configured to "pci"

Tracked-On: #7556
Signed-off-by: Kunhui-Li <kunhuix.li@...>
Reviewed-by: Junjie Mao <junjie.mao@...>

--
Best Regards
Junjie Mao

---
misc/config_tools/launch_config/launch_cfg_gen.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py
index 0a8b34b36..f2cd99d71 100755
--- a/misc/config_tools/launch_config/launch_cfg_gen.py
+++ b/misc/config_tools/launch_config/launch_cfg_gen.py
@@ -263,8 +263,8 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id
script.add_virtual_device("uart", options="vuart_idx:0")

for idx, conn in enumerate(eval_xpath_all(hv_scenario_etree, f".//vuart_connection[endpoint/vm_name = '{vm_name}']"), start=1):
- if eval_xpath(conn, "./type") == "pci":
- script.add_virtual_device("uart", options="vuart_idx:{idx}")
+ if eval_xpath(conn, "./type/text()") == "pci":
+ script.add_virtual_device("uart", options=f"vuart_idx:{idx}")

# Mediated PCI devices, including virtio
for usb_xhci in eval_xpath_all(vm_scenario_etree, ".//usb_xhci/usb_dev[text() != '']/text()"):


Re: [PATCH v3] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)

v2-->v3:
use enum titles to show more user-friendly names in the configurator

v1->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/schema/VMtypes.xsd | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index f75ff9bc0..1de2fecbf 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -95,7 +95,7 @@ export default {
},
data() {
return {
- ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
+ ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enumNames'],
I'm not familiar with how to specify the values and titles of select
widgets in vue. Please make sure this change does the job properly
(i.e. it only affects the shown names of this select, but does not
impact the data filled in the json object).

--
Best Regards
Junjie Mao

ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..73699c824 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -336,8 +336,12 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="Virtio console" >
+ <xs:annotation acrn:title="virtio serial port (as console)" />
+ </xs:enumeration>
+ <xs:enumeration value="Virtio serial port" >
+ <xs:annotation acrn:title="virtio serial port" />
+ </xs:enumeration>
</xs:restriction>
</xs:simpleType>


Re: [PATCH v3] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)

v2-->v3:
use enum titles to show more user-friendly names in the configurator

v1->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
Reviewed-by: Junjie Mao <junjie.mao@...>

--
Best Regards
Junjie Mao

---
.../Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/schema/VMtypes.xsd | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index f75ff9bc0..1de2fecbf 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -95,7 +95,7 @@ export default {
},
data() {
return {
- ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
+ ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enumNames'],
ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..73699c824 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -336,8 +336,12 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="Virtio console" >
+ <xs:annotation acrn:title="virtio serial port (as console)" />
+ </xs:enumeration>
+ <xs:enumeration value="Virtio serial port" >
+ <xs:annotation acrn:title="virtio serial port" />
+ </xs:enumeration>
</xs:restriction>
</xs:simpleType>


[PATCH v3] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Kunhui Li
 

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)

v2-->v3:
use enum titles to show more user-friendly names in the configurator

v1->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../Config/ConfigForm/CustomWidget/Virtio/Console.vue | 2 +-
misc/config_tools/schema/VMtypes.xsd | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index f75ff9bc0..1de2fecbf 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -95,7 +95,7 @@ export default {
},
data() {
return {
- ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
+ ConsoleUseType: this.rootSchema.definitions['VirtioConsoleUseType']['enumNames'],
ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
};
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..73699c824 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -336,8 +336,12 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</
<xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="Virtio console" >
+ <xs:annotation acrn:title="virtio serial port (as console)" />
+ </xs:enumeration>
+ <xs:enumeration value="Virtio serial port" >
+ <xs:annotation acrn:title="virtio serial port" />
+ </xs:enumeration>
</xs:restriction>
</xs:simpleType>

--
2.25.1


Re: [PATCH v2] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Kunhui Li
 

-----Original Message-----
From: Mao, Junjie <junjie.mao@...>
Sent: Tuesday, May 24, 2022 1:22 PM
To: Li, KunhuiX <kunhuix.li@...>
Cc: acrn-dev@...; Xie, Nanlin <nanlin.xie@...>
Subject: Re: [PATCH v2] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Kunhui-Li <kunhuix.li@...> writes:

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)
I'm fine with the change themselves, but if it's just a rename of
existing enumeration constants for clarity, why don't we use enum titles
to show more user-friendly names in the configurator? With that we don't
need to modify the actual values and the underlying logic.
Good point, will update.

--
Best Regards
Junjie Mao


v1-->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../data/cfl-k700-i7/hybrid_launch_2user_vm.xml | 2 +-
misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml | 2 +-
.../data/cfl-k700-i7/shared_launch_6user_vm.xml | 10 +++++-----
.../data/generic_board/hybrid_launch_2user_vm.xml | 2 +-
misc/config_tools/data/generic_board/hybrid_rt.xml | 2 +-
.../data/generic_board/shared_launch_6user_vm.xml | 10 +++++-----
.../data/nuc11tnbi5/hybrid_launch_2user_vm.xml | 2 +-
.../data/nuc11tnbi5/shared_launch_6user_vm.xml | 10 +++++-----
.../data/tgl-vecow-spc-7100-Corei7/hybrid.xml | 4 ++--
.../shared_launch_2user_vm.xml | 4 ++--
misc/config_tools/data/whl-ipc-i5/hybrid.xml | 2 +-
.../data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_2user_vm.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_6user_vm.xml | 10 +++++-----
misc/config_tools/launch_config/launch_cfg_gen.py | 2 +-
misc/config_tools/scenario_config/upgrader.py | 10 ++++++++--
misc/config_tools/schema/VMtypes.xsd | 6 +++---
19 files changed, 46 insertions(+), 40 deletions(-)

diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml b/misc/config_tools/data/cfl-k700-
i7/hybrid_launch_2user_vm.xml
index 018889e62..ba6ef5a47 100644
--- a/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
index d320ea403..9fafb47e8 100644
--- a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
+++ b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
@@ -226,7 +226,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml b/misc/config_tools/data/cfl-k700-
i7/shared_launch_6user_vm.xml
index 9ff217f93..d404f8814 100644
--- a/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml
@@ -138,7 +138,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -175,7 +175,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -212,7 +212,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -249,7 +249,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -286,7 +286,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
b/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
index 5f4befa6f..67347ed0e 100644
--- a/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/hybrid_rt.xml b/misc/config_tools/data/generic_board/hybrid_rt.xml
index 7a56666eb..ecee3a1bf 100644
--- a/misc/config_tools/data/generic_board/hybrid_rt.xml
+++ b/misc/config_tools/data/generic_board/hybrid_rt.xml
@@ -197,7 +197,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
b/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
index db94c8475..d784c586c 100644
--- a/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
@@ -138,7 +138,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -175,7 +175,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -212,7 +212,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -249,7 +249,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -286,7 +286,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
b/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
index 5f4befa6f..67347ed0e 100644
--- a/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
b/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
index 9c053add1..aa4fe5648 100644
--- a/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
@@ -150,7 +150,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -187,7 +187,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -224,7 +224,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -261,7 +261,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -298,7 +298,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml b/misc/config_tools/data/tgl-vecow-spc-7100-
Corei7/hybrid.xml
index f876c2eda..d7a9310d1 100644
--- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml
+++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml
@@ -147,7 +147,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -180,7 +180,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml b/misc/config_tools/data/tgl-vecow-spc-
7100-Corei7/shared_launch_2user_vm.xml
index 6d1d17c3b..823c55b62 100644
--- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml
+++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml
@@ -115,7 +115,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -156,7 +156,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid.xml b/misc/config_tools/data/whl-ipc-i5/hybrid.xml
index d79a2f429..d1badffe3 100644
--- a/misc/config_tools/data/whl-ipc-i5/hybrid.xml
+++ b/misc/config_tools/data/whl-ipc-i5/hybrid.xml
@@ -174,7 +174,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml b/misc/config_tools/data/whl-ipc-
i5/hybrid_rt_launch_1user_vm_waag.xml
index 349624471..0ea4f63f6 100644
--- a/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml
+++ b/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml
@@ -204,7 +204,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml b/misc/config_tools/data/whl-ipc-
i5/shared_launch_1user_vm_hardrt.xml
index 59b29bb1b..7cbe29776 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml
@@ -119,7 +119,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml b/misc/config_tools/data/whl-ipc-
i5/shared_launch_1user_vm_vxworks.xml
index ac3a4e3ee..f30cabfb5 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml
@@ -101,7 +101,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network/>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml b/misc/config_tools/data/whl-ipc-
i5/shared_launch_2user_vm.xml
index 61a57cb4c..c8beb61d3 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml
@@ -139,7 +139,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml b/misc/config_tools/data/whl-ipc-
i5/shared_launch_6user_vm.xml
index 7728fadd5..0eed58285 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml
@@ -139,7 +139,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -213,7 +213,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -250,7 +250,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -287,7 +287,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py
index 0a8b34b36..283f9a644 100755
--- a/misc/config_tools/launch_config/launch_cfg_gen.py
+++ b/misc/config_tools/launch_config/launch_cfg_gen.py
@@ -283,7 +283,7 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id
preceding_mask = ""
use_type = eval_xpath(virtio_console_etree, "./use_type/text()")
backend_type = eval_xpath(virtio_console_etree, "./backend_type/text()")
- if use_type == "Virtio console":
+ if use_type == "virtio serial port (as console)":
preceding_mask = "@"

if backend_type == "file":
diff --git a/misc/config_tools/scenario_config/upgrader.py b/misc/config_tools/scenario_config/upgrader.py
index ae28cb446..231aecbae 100755
--- a/misc/config_tools/scenario_config/upgrader.py
+++ b/misc/config_tools/scenario_config/upgrader.py
@@ -241,12 +241,18 @@ class VirtioDevices(object):
self.consoles = []

def console_encoding(self, console):
+ use_type_mapping = {
+ "Virtio console": "virtio serial port (as console)",
+ "virtio serial port (as console)": "virtio serial port (as console)",
+ "Virtio serial port": "virtio serial port",
+ "virtio serial port": "virtio serial port",
+ }
if console.text is not None:
- use_type = "Virtio console" if console.text.startswith("@") else "Virtio serial port"
+ use_type = use_type_mapping["Virtio console"] if console.text.startswith("@") else use_type_mapping["Virtio serial port"]
backend_type = console.text.split(":")[0].replace("@", "")
file_path = console.text.split("=")[1].split(":")[0] if "=" in console.text else None
else:
- use_type = console.xpath("./use_type")[0].text if console.xpath("./use_type") else None
+ use_type = use_type_mapping[console.xpath("./use_type")[0].text] if console.xpath("./use_type") else None
backend_type = console.xpath("./backend_type")[0].text if console.xpath("./backend_type") else None
file_path = console.xpath("./file_path")[0].text if console.xpath("./file_path") else None
self.consoles.append((use_type, backend_type, file_path))
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..c748bbc6b 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -333,11 +333,11 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</

<xs:simpleType name="VirtioConsoleUseType">
<xs:annotation>
- <xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
+ <xs:documentation>A string with value: ``virtio serial port (as console)`` or ``virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="virtio serial port (as console)" />
+ <xs:enumeration value="virtio serial port" />
</xs:restriction>
</xs:simpleType>


[PATCH] config_tools: bugfix for the generated launch script without uart parameters

Kunhui Li
 

bugfix for the generated launch script without uart parameters
after VUART is configured to "pci"

Tracked-On: #7556
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
misc/config_tools/launch_config/launch_cfg_gen.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py
index 0a8b34b36..f2cd99d71 100755
--- a/misc/config_tools/launch_config/launch_cfg_gen.py
+++ b/misc/config_tools/launch_config/launch_cfg_gen.py
@@ -263,8 +263,8 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id
script.add_virtual_device("uart", options="vuart_idx:0")

for idx, conn in enumerate(eval_xpath_all(hv_scenario_etree, f".//vuart_connection[endpoint/vm_name = '{vm_name}']"), start=1):
- if eval_xpath(conn, "./type") == "pci":
- script.add_virtual_device("uart", options="vuart_idx:{idx}")
+ if eval_xpath(conn, "./type/text()") == "pci":
+ script.add_virtual_device("uart", options=f"vuart_idx:{idx}")

# Mediated PCI devices, including virtio
for usb_xhci in eval_xpath_all(vm_scenario_etree, ".//usb_xhci/usb_dev[text() != '']/text()"):
--
2.25.1


Re: [PATCH v2] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)
I'm fine with the change themselves, but if it's just a rename of
existing enumeration constants for clarity, why don't we use enum titles
to show more user-friendly names in the configurator? With that we don't
need to modify the actual values and the underlying logic.

--
Best Regards
Junjie Mao


v1-->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../data/cfl-k700-i7/hybrid_launch_2user_vm.xml | 2 +-
misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml | 2 +-
.../data/cfl-k700-i7/shared_launch_6user_vm.xml | 10 +++++-----
.../data/generic_board/hybrid_launch_2user_vm.xml | 2 +-
misc/config_tools/data/generic_board/hybrid_rt.xml | 2 +-
.../data/generic_board/shared_launch_6user_vm.xml | 10 +++++-----
.../data/nuc11tnbi5/hybrid_launch_2user_vm.xml | 2 +-
.../data/nuc11tnbi5/shared_launch_6user_vm.xml | 10 +++++-----
.../data/tgl-vecow-spc-7100-Corei7/hybrid.xml | 4 ++--
.../shared_launch_2user_vm.xml | 4 ++--
misc/config_tools/data/whl-ipc-i5/hybrid.xml | 2 +-
.../data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_2user_vm.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_6user_vm.xml | 10 +++++-----
misc/config_tools/launch_config/launch_cfg_gen.py | 2 +-
misc/config_tools/scenario_config/upgrader.py | 10 ++++++++--
misc/config_tools/schema/VMtypes.xsd | 6 +++---
19 files changed, 46 insertions(+), 40 deletions(-)

diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml b/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml
index 018889e62..ba6ef5a47 100644
--- a/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
index d320ea403..9fafb47e8 100644
--- a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
+++ b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
@@ -226,7 +226,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml b/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml
index 9ff217f93..d404f8814 100644
--- a/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml
@@ -138,7 +138,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -175,7 +175,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -212,7 +212,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -249,7 +249,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -286,7 +286,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml b/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
index 5f4befa6f..67347ed0e 100644
--- a/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/hybrid_rt.xml b/misc/config_tools/data/generic_board/hybrid_rt.xml
index 7a56666eb..ecee3a1bf 100644
--- a/misc/config_tools/data/generic_board/hybrid_rt.xml
+++ b/misc/config_tools/data/generic_board/hybrid_rt.xml
@@ -197,7 +197,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml b/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
index db94c8475..d784c586c 100644
--- a/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
@@ -138,7 +138,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -175,7 +175,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -212,7 +212,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -249,7 +249,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -286,7 +286,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml b/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
index 5f4befa6f..67347ed0e 100644
--- a/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml b/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
index 9c053add1..aa4fe5648 100644
--- a/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
@@ -150,7 +150,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -187,7 +187,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -224,7 +224,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -261,7 +261,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -298,7 +298,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml
index f876c2eda..d7a9310d1 100644
--- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml
+++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml
@@ -147,7 +147,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -180,7 +180,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml
index 6d1d17c3b..823c55b62 100644
--- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml
+++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml
@@ -115,7 +115,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -156,7 +156,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid.xml b/misc/config_tools/data/whl-ipc-i5/hybrid.xml
index d79a2f429..d1badffe3 100644
--- a/misc/config_tools/data/whl-ipc-i5/hybrid.xml
+++ b/misc/config_tools/data/whl-ipc-i5/hybrid.xml
@@ -174,7 +174,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml b/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml
index 349624471..0ea4f63f6 100644
--- a/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml
+++ b/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml
@@ -204,7 +204,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml
index 59b29bb1b..7cbe29776 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml
@@ -119,7 +119,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml
index ac3a4e3ee..f30cabfb5 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml
@@ -101,7 +101,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network/>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml
index 61a57cb4c..c8beb61d3 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml
@@ -139,7 +139,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml
index 7728fadd5..0eed58285 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml
@@ -139,7 +139,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -213,7 +213,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -250,7 +250,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -287,7 +287,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py
index 0a8b34b36..283f9a644 100755
--- a/misc/config_tools/launch_config/launch_cfg_gen.py
+++ b/misc/config_tools/launch_config/launch_cfg_gen.py
@@ -283,7 +283,7 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id
preceding_mask = ""
use_type = eval_xpath(virtio_console_etree, "./use_type/text()")
backend_type = eval_xpath(virtio_console_etree, "./backend_type/text()")
- if use_type == "Virtio console":
+ if use_type == "virtio serial port (as console)":
preceding_mask = "@"

if backend_type == "file":
diff --git a/misc/config_tools/scenario_config/upgrader.py b/misc/config_tools/scenario_config/upgrader.py
index ae28cb446..231aecbae 100755
--- a/misc/config_tools/scenario_config/upgrader.py
+++ b/misc/config_tools/scenario_config/upgrader.py
@@ -241,12 +241,18 @@ class VirtioDevices(object):
self.consoles = []

def console_encoding(self, console):
+ use_type_mapping = {
+ "Virtio console": "virtio serial port (as console)",
+ "virtio serial port (as console)": "virtio serial port (as console)",
+ "Virtio serial port": "virtio serial port",
+ "virtio serial port": "virtio serial port",
+ }
if console.text is not None:
- use_type = "Virtio console" if console.text.startswith("@") else "Virtio serial port"
+ use_type = use_type_mapping["Virtio console"] if console.text.startswith("@") else use_type_mapping["Virtio serial port"]
backend_type = console.text.split(":")[0].replace("@", "")
file_path = console.text.split("=")[1].split(":")[0] if "=" in console.text else None
else:
- use_type = console.xpath("./use_type")[0].text if console.xpath("./use_type") else None
+ use_type = use_type_mapping[console.xpath("./use_type")[0].text] if console.xpath("./use_type") else None
backend_type = console.xpath("./backend_type")[0].text if console.xpath("./backend_type") else None
file_path = console.xpath("./file_path")[0].text if console.xpath("./file_path") else None
self.consoles.append((use_type, backend_type, file_path))
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..c748bbc6b 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -333,11 +333,11 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</

<xs:simpleType name="VirtioConsoleUseType">
<xs:annotation>
- <xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
+ <xs:documentation>A string with value: ``virtio serial port (as console)`` or ``virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="virtio serial port (as console)" />
+ <xs:enumeration value="virtio serial port" />
</xs:restriction>
</xs:simpleType>


[PATCH v2] config_tools: rename "Virtio console" to "virtio serial port (as console)"

Kunhui Li
 

virtio serial port and virtio console are all based on virito serial port.
but virtio serial port functionally can not be used as console,
which may lead to user confusion, so explicitly specify the point by
changing the item name as follows:
Virtio console -> virtio serial port (as console)

v1-->v2:
In upgrader.py, use a dict to map all historial values for "use_type" element.

Tracked-On: #7540
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../data/cfl-k700-i7/hybrid_launch_2user_vm.xml | 2 +-
misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml | 2 +-
.../data/cfl-k700-i7/shared_launch_6user_vm.xml | 10 +++++-----
.../data/generic_board/hybrid_launch_2user_vm.xml | 2 +-
misc/config_tools/data/generic_board/hybrid_rt.xml | 2 +-
.../data/generic_board/shared_launch_6user_vm.xml | 10 +++++-----
.../data/nuc11tnbi5/hybrid_launch_2user_vm.xml | 2 +-
.../data/nuc11tnbi5/shared_launch_6user_vm.xml | 10 +++++-----
.../data/tgl-vecow-spc-7100-Corei7/hybrid.xml | 4 ++--
.../shared_launch_2user_vm.xml | 4 ++--
misc/config_tools/data/whl-ipc-i5/hybrid.xml | 2 +-
.../data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_2user_vm.xml | 2 +-
.../data/whl-ipc-i5/shared_launch_6user_vm.xml | 10 +++++-----
misc/config_tools/launch_config/launch_cfg_gen.py | 2 +-
misc/config_tools/scenario_config/upgrader.py | 10 ++++++++--
misc/config_tools/schema/VMtypes.xsd | 6 +++---
19 files changed, 46 insertions(+), 40 deletions(-)

diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml b/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml
index 018889e62..ba6ef5a47 100644
--- a/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
index d320ea403..9fafb47e8 100644
--- a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
+++ b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml
@@ -226,7 +226,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml b/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml
index 9ff217f93..d404f8814 100644
--- a/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml
@@ -138,7 +138,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -175,7 +175,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -212,7 +212,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -249,7 +249,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -286,7 +286,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml b/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
index 5f4befa6f..67347ed0e 100644
--- a/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/hybrid_rt.xml b/misc/config_tools/data/generic_board/hybrid_rt.xml
index 7a56666eb..ecee3a1bf 100644
--- a/misc/config_tools/data/generic_board/hybrid_rt.xml
+++ b/misc/config_tools/data/generic_board/hybrid_rt.xml
@@ -197,7 +197,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml b/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
index db94c8475..d784c586c 100644
--- a/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml
@@ -138,7 +138,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -175,7 +175,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -212,7 +212,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -249,7 +249,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -286,7 +286,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml b/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
index 5f4befa6f..67347ed0e 100644
--- a/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
+++ b/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml b/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
index 9c053add1..aa4fe5648 100644
--- a/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml
@@ -150,7 +150,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -187,7 +187,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -224,7 +224,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -261,7 +261,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -298,7 +298,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml
index f876c2eda..d7a9310d1 100644
--- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml
+++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml
@@ -147,7 +147,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -180,7 +180,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml
index 6d1d17c3b..823c55b62 100644
--- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml
+++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml
@@ -115,7 +115,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -156,7 +156,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid.xml b/misc/config_tools/data/whl-ipc-i5/hybrid.xml
index d79a2f429..d1badffe3 100644
--- a/misc/config_tools/data/whl-ipc-i5/hybrid.xml
+++ b/misc/config_tools/data/whl-ipc-i5/hybrid.xml
@@ -174,7 +174,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml b/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml
index 349624471..0ea4f63f6 100644
--- a/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml
+++ b/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml
@@ -204,7 +204,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml
index 59b29bb1b..7cbe29776 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml
@@ -119,7 +119,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml
index ac3a4e3ee..f30cabfb5 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml
@@ -101,7 +101,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network/>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml
index 61a57cb4c..c8beb61d3 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml
@@ -139,7 +139,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml
index 7728fadd5..0eed58285 100644
--- a/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml
+++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml
@@ -139,7 +139,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -176,7 +176,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -213,7 +213,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -250,7 +250,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
@@ -287,7 +287,7 @@
<usb_xhci/>
<virtio_devices>
<console>
- <use_type>Virtio console</use_type>
+ <use_type>virtio serial port (as console)</use_type>
<backend_type>stdio</backend_type>
</console>
<network>
diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py
index 0a8b34b36..283f9a644 100755
--- a/misc/config_tools/launch_config/launch_cfg_gen.py
+++ b/misc/config_tools/launch_config/launch_cfg_gen.py
@@ -283,7 +283,7 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id
preceding_mask = ""
use_type = eval_xpath(virtio_console_etree, "./use_type/text()")
backend_type = eval_xpath(virtio_console_etree, "./backend_type/text()")
- if use_type == "Virtio console":
+ if use_type == "virtio serial port (as console)":
preceding_mask = "@"

if backend_type == "file":
diff --git a/misc/config_tools/scenario_config/upgrader.py b/misc/config_tools/scenario_config/upgrader.py
index ae28cb446..231aecbae 100755
--- a/misc/config_tools/scenario_config/upgrader.py
+++ b/misc/config_tools/scenario_config/upgrader.py
@@ -241,12 +241,18 @@ class VirtioDevices(object):
self.consoles = []

def console_encoding(self, console):
+ use_type_mapping = {
+ "Virtio console": "virtio serial port (as console)",
+ "virtio serial port (as console)": "virtio serial port (as console)",
+ "Virtio serial port": "virtio serial port",
+ "virtio serial port": "virtio serial port",
+ }
if console.text is not None:
- use_type = "Virtio console" if console.text.startswith("@") else "Virtio serial port"
+ use_type = use_type_mapping["Virtio console"] if console.text.startswith("@") else use_type_mapping["Virtio serial port"]
backend_type = console.text.split(":")[0].replace("@", "")
file_path = console.text.split("=")[1].split(":")[0] if "=" in console.text else None
else:
- use_type = console.xpath("./use_type")[0].text if console.xpath("./use_type") else None
+ use_type = use_type_mapping[console.xpath("./use_type")[0].text] if console.xpath("./use_type") else None
backend_type = console.xpath("./backend_type")[0].text if console.xpath("./backend_type") else None
file_path = console.xpath("./file_path")[0].text if console.xpath("./file_path") else None
self.consoles.append((use_type, backend_type, file_path))
diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd
index ea612e144..c748bbc6b 100644
--- a/misc/config_tools/schema/VMtypes.xsd
+++ b/misc/config_tools/schema/VMtypes.xsd
@@ -333,11 +333,11 @@ The size is a subset of the VM's total memory size specified on the Basic tab.</

<xs:simpleType name="VirtioConsoleUseType">
<xs:annotation>
- <xs:documentation>A string with value: ``Virtio console`` or ``Virtio serial port``</xs:documentation>
+ <xs:documentation>A string with value: ``virtio serial port (as console)`` or ``virtio serial port``</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
- <xs:enumeration value="Virtio console" />
- <xs:enumeration value="Virtio serial port" />
+ <xs:enumeration value="virtio serial port (as console)" />
+ <xs:enumeration value="virtio serial port" />
</xs:restriction>
</xs:simpleType>

--
2.25.1

961 - 980 of 37092