Skip to content

Commit b6538a4

Browse files
Kunhui-Liacrnsi-robot
authored andcommitted
config_tools: fix the issue that got wrong device name after specifying mac address
If user add the specific mac address (eg: mac=00:16:3E:77:A9:41) in launch script, we will get the device name with the specified mac address. This is unexpected. This patch updates the parser to fix the issue. v1-->v2: Update the parser with regex. Tracked-On: projectacrn#7197 Signed-off-by: Kunhui-Li <[email protected]> Reviewed-by: Junjie Mao <[email protected]>
1 parent 95a9c05 commit b6538a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

misc/config_tools/launch_config/launch_script_template.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ function add_virtual_device() {
127127

128128
if [ "${kind}" = "virtio-net" ]; then
129129
# Create the tap device
130-
tap_conf=${options%,*}
131-
create_tap "${tap_conf#tap=}" >> /dev/stderr
130+
if [[ ${options} =~ tap=([^,]+) ]]; then
131+
tap_conf="${BASH_REMATCH[1]}"
132+
create_tap "${tap_conf}" >> /dev/stderr
133+
fi
132134
fi
133135

134136
echo -n "-s ${slot},${kind}"

0 commit comments

Comments
 (0)