Skip to content

Commit d1806f4

Browse files
prashanth-intelsysopenci
authored andcommitted
Disable host input on Android CIV
- Disable host input based on value from ini file. Tracked-On: OAM-110573 Signed-off-by: Suresh, Prashanth <prashanth.suresh@intel.com>
1 parent 4de8afe commit d1806f4

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 4a96c509b3838cc40a82ead0dee83b88d28c3341 Mon Sep 17 00:00:00 2001
2+
From: "Suresh, Prashanth" <prashanth.suresh@intel.com>
3+
Date: Thu, 1 Jun 2023 19:31:04 +0530
4+
Subject: [PATCH] Add parameter to disable host input.
5+
6+
Tracked-On:
7+
Signed-off-by: Suresh, Prashanth <prashanth.suresh@intel.com>
8+
---
9+
sample/guest01.ini | 1 +
10+
1 file changed, 1 insertion(+)
11+
12+
diff --git a/sample/guest01.ini b/sample/guest01.ini
13+
index 225402a..d2c687d 100644
14+
--- a/sample/guest01.ini
15+
+++ b/sample/guest01.ini
16+
@@ -77,6 +77,7 @@ audio_type=legacy-hda
17+
#connectors_0=
18+
#connectors_1=
19+
#show_fps=
20+
+#disable_host_input=no
21+
22+
[passthrough]
23+
#specified the PCI id here if you want to passthrough it to guest, seperate them with comma
24+
--
25+
2.40.1
26+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 0c7c3ebbf273e82f77dc45d6f6a053530589c07a Mon Sep 17 00:00:00 2001
2+
From: "Suresh, Prashanth" <prashanth.suresh@intel.com>
3+
Date: Thu, 1 Jun 2023 19:25:22 +0530
4+
Subject: [PATCH] Disable host input on Android CIV
5+
6+
- Disable host input based on value from ini file.
7+
---
8+
src/guest/config_parser.cc | 2 +-
9+
src/guest/config_parser.h | 1 +
10+
src/guest/vm_builder_qemu.cc | 6 ++++++
11+
3 files changed, 8 insertions(+), 1 deletion(-)
12+
13+
diff --git a/src/guest/config_parser.cc b/src/guest/config_parser.cc
14+
index 9946a2f..6cfaae5 100644
15+
--- a/src/guest/config_parser.cc
16+
+++ b/src/guest/config_parser.cc
17+
@@ -35,7 +35,7 @@ map<string_view, vector<string_view>> kConfigMap = {
18+
{ kGroupFirm, { kFirmType, kFirmPath, kFirmCode, kFirmVars } },
19+
{ kGroupDisk, { kDiskSize, kDiskPath } },
20+
{ kGroupVgpu, { kVgpuType, kVgpuGvtgVer, kVgpuUuid, kVgpuMonId, kVgpuOutputs } },
21+
- { kGroupDisplay, { kDispOptions, kDispConnector0, kDispConnector1, kDispShowFps } },
22+
+ { kGroupDisplay, { kDispOptions, kDispConnector0, kDispConnector1, kDispShowFps, kDisableHostInput } },
23+
{ kGroupNet, { kNetModel, kNetAdbPort, kNetFastbootPort } },
24+
{ kGroupVtpm, { kVtpmBinPath, kVtpmDataDir } },
25+
{ kGroupRpmb, { kRpmbBinPath, kRpmbDataDir } },
26+
diff --git a/src/guest/config_parser.h b/src/guest/config_parser.h
27+
index b793907..80d8a12 100644
28+
--- a/src/guest/config_parser.h
29+
+++ b/src/guest/config_parser.h
30+
@@ -64,6 +64,7 @@ constexpr char kDispOptions[] = "options";
31+
constexpr char kDispConnector0[] = "connectors_0";
32+
constexpr char kDispConnector1[] = "connectors_1";
33+
constexpr char kDispShowFps[] = "show_fps";
34+
+constexpr char kDisableHostInput[] = "disable_host_input";
35+
36+
constexpr char kNetModel[] = "model";
37+
constexpr char kNetAdbPort[] = "adb_port";
38+
diff --git a/src/guest/vm_builder_qemu.cc b/src/guest/vm_builder_qemu.cc
39+
index 21a18eb..c106684 100644
40+
--- a/src/guest/vm_builder_qemu.cc
41+
+++ b/src/guest/vm_builder_qemu.cc
42+
@@ -332,6 +332,12 @@ bool VmBuilderQemu::SetupSriov(void) {
43+
44+
emul_cmd_.append(connector_str);
45+
46+
+ std::string disable_host_input = cfg_.GetValue(kGroupDisplay, kDisableHostInput);
47+
+ if((!disable_host_input.empty()) && disable_host_input.compare("yes") == 0) {
48+
+ LOG(info) << "Disabling host input";
49+
+ emul_cmd_.append("input=off");
50+
+ }
51+
+
52+
std::string mem_size = cfg_.GetValue(kGroupMem, kMemSize);
53+
boost::trim(mem_size);
54+
55+
--
56+
2.34.1
57+

0 commit comments

Comments
 (0)