Merge "Remove unused dependency."
diff --git a/apex/Android.bp b/apex/Android.bp
index bc9e084..41d2f62 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -51,6 +51,7 @@
prebuilts: [
"com.android.virt.init.rc",
"microdroid_cdisk.json",
+ "microdroid_cdisk_env.json",
"microdroid_uboot_env",
"microdroid_bootloader",
],
diff --git a/microdroid/Android.bp b/microdroid/Android.bp
index 8456591..150f119 100644
--- a/microdroid/Android.bp
+++ b/microdroid/Android.bp
@@ -338,3 +338,8 @@
name: "microdroid_cdisk.json",
src: "microdroid_cdisk.json",
}
+
+prebuilt_etc {
+ name: "microdroid_cdisk_env.json",
+ src: "microdroid_cdisk_env.json",
+}
diff --git a/microdroid/README.md b/microdroid/README.md
index db9ed1a..a4bfb6e 100644
--- a/microdroid/README.md
+++ b/microdroid/README.md
@@ -35,7 +35,8 @@
$ adb shell 'cp /apex/com.android.virt/etc/uboot_env.img /data/local/tmp'
$ adb shell 'dd if=/dev/zero of=/data/local/tmp/misc.img bs=4k count=256'
$ adb shell 'cd /data/local/tmp; /apex/com.android.virt/bin/mk_cdisk /apex/com.android.virt/etc/microdroid_cdisk.json os_composite.img'
-$ adb shell 'cd /data/local/tmp; /apex/com.android.virt/bin/crosvm run --cid=5 --disable-sandbox --bios=bootloader --serial=type=stdout --disk=os_composite.img'
+$ adb shell 'cd /data/local/tmp; /apex/com.android.virt/bin/mk_cdisk /apex/com.android.virt/etc/microdroid_cdisk_env.json env_composite.img'
+$ adb shell 'cd /data/local/tmp; /apex/com.android.virt/bin/crosvm run --cid=5 --disable-sandbox --bios=bootloader --serial=type=stdout --disk=os_composite.img --disk=env_composite.img'
```
The CID in `--cid` parameter can be anything greater than 2 (`VMADDR_CID_HOST`).
diff --git a/microdroid/microdroid_cdisk.json b/microdroid/microdroid_cdisk.json
index 88b7183..591e83b 100644
--- a/microdroid/microdroid_cdisk.json
+++ b/microdroid/microdroid_cdisk.json
@@ -1,11 +1,6 @@
{
"partitions": [
{
- "label": "uboot_env",
- "path": "uboot_env.img",
- "read_only": true
- },
- {
"label": "misc",
"path": "misc.img",
"read_only": true
diff --git a/microdroid/microdroid_cdisk_env.json b/microdroid/microdroid_cdisk_env.json
new file mode 100644
index 0000000..f43c4b1
--- /dev/null
+++ b/microdroid/microdroid_cdisk_env.json
@@ -0,0 +1,9 @@
+{
+ "partitions": [
+ {
+ "label": "uboot_env",
+ "path": "uboot_env.img",
+ "read_only": true
+ }
+ ]
+}
diff --git a/tests/hostside/java/android/virt/test/MicrodroidTestCase.java b/tests/hostside/java/android/virt/test/MicrodroidTestCase.java
index 4acdf4b..44a2952 100644
--- a/tests/hostside/java/android/virt/test/MicrodroidTestCase.java
+++ b/tests/hostside/java/android/virt/test/MicrodroidTestCase.java
@@ -65,16 +65,23 @@
TEST_ROOT, TEST_ROOT, VIRT_APEX, VIRT_APEX, VIRT_APEX);
getDevice().executeShellCommand(prepareImagesCmd);
- // Create os_composite.img
+ // Create os_composite.img and env_composite.img
String makeOsCompositeCmd =
String.format(
"cd %s; %sbin/mk_cdisk %setc/microdroid_cdisk.json os_composite.img",
TEST_ROOT, VIRT_APEX, VIRT_APEX);
getDevice().executeShellCommand(makeOsCompositeCmd);
+ String makeEnvCompositeCmd =
+ String.format(
+ "cd %s; %sbin/mk_cdisk %setc/microdroid_cdisk_env.json env_composite.img",
+ TEST_ROOT, VIRT_APEX, VIRT_APEX);
+ getDevice().executeShellCommand(makeEnvCompositeCmd);
- // Make sure that os_composite.img is created
+ // Make sure that the composite images are created
final String compositeImg = TEST_ROOT + "/os_composite.img";
- CommandResult result = getDevice().executeShellV2Command("du -b " + compositeImg);
+ final String envCompositeImg = TEST_ROOT + "/env_composite.img";
+ CommandResult result =
+ getDevice().executeShellV2Command("du -b " + compositeImg + " " + envCompositeImg);
assertThat(result.getExitCode(), is(0));
assertThat(result.getStdout(), is(not("")));
@@ -83,7 +90,8 @@
String runMicrodroidCmd =
String.format(
"cd %s; %sbin/crosvm run --cid=%d --disable-sandbox --bios=bootloader"
- + " --serial=type=syslog --disk=os_composite.img",
+ + " --serial=type=syslog --disk=os_composite.img"
+ + " --disk=env_composite.img",
TEST_ROOT, VIRT_APEX, TEST_VM_CID);
executor.execute(
() -> {
diff --git a/virtmanager/aidl/android/system/virtmanager/VirtualMachineDebugInfo.aidl b/virtmanager/aidl/android/system/virtmanager/VirtualMachineDebugInfo.aidl
index d1ba9a6..3a271cb 100644
--- a/virtmanager/aidl/android/system/virtmanager/VirtualMachineDebugInfo.aidl
+++ b/virtmanager/aidl/android/system/virtmanager/VirtualMachineDebugInfo.aidl
@@ -19,13 +19,16 @@
parcelable VirtualMachineDebugInfo {
/** The CID assigned to the VM. */
int cid;
+
/** The UID of the process which requested the VM. */
- int requester_uid;
+ int requesterUid;
+
/** The SID of the process which requested the VM. */
- @nullable String requester_sid;
+ @nullable String requesterSid;
+
/**
* The PID of the process which requested the VM. Note that this process may no longer exist and
* the PID may have been reused for a different process, so this should not be trusted.
*/
- int requester_pid;
+ int requesterPid;
}
diff --git a/virtmanager/src/aidl.rs b/virtmanager/src/aidl.rs
index bc3ea1a..96ba04f 100644
--- a/virtmanager/src/aidl.rs
+++ b/virtmanager/src/aidl.rs
@@ -96,9 +96,9 @@
.into_iter()
.map(|vm| VirtualMachineDebugInfo {
cid: vm.cid as i32,
- requester_uid: vm.requester_uid as i32,
- requester_sid: vm.requester_sid.clone(),
- requester_pid: vm.requester_pid,
+ requesterUid: vm.requester_uid as i32,
+ requesterSid: vm.requester_sid.clone(),
+ requesterPid: vm.requester_pid,
})
.collect();
Ok(cids)