Home
last modified time | relevance | path

Searched refs:vm (Results 1 – 25 of 81) sorted by relevance

1234

/packages/modules/Virtualization/javalib/src/android/system/virtualmachine/
DVirtualMachineManager.java148 VirtualMachine vm = VirtualMachine.create(mContext, name, config); in createLocked() local
149 mVmsByName.put(name, new WeakReference<>(vm)); in createLocked()
150 return vm; in createLocked()
180 VirtualMachine vm = getVmByName(name); in getLocked() local
181 if (vm != null) return vm; in getLocked()
183 vm = VirtualMachine.load(mContext, name); in getLocked()
184 if (vm != null) { in getLocked()
185 mVmsByName.put(name, new WeakReference<>(vm)); in getLocked()
187 return vm; in getLocked()
210 VirtualMachine vm = VirtualMachine.fromDescriptor(mContext, name, vmDescriptor); in importFromDescriptor() local
[all …]
DVirtualMachineCallback.java141 void onPayloadStarted(@NonNull VirtualMachine vm); in onPayloadStarted() argument
147 void onPayloadReady(@NonNull VirtualMachine vm); in onPayloadReady() argument
150 void onPayloadFinished(@NonNull VirtualMachine vm, int exitCode); in onPayloadFinished() argument
153 void onError(@NonNull VirtualMachine vm, @ErrorCode int errorCode, @NonNull String message); in onError() argument
156 void onStopped(@NonNull VirtualMachine vm, @StopReason int reason); in onStopped() argument
DVirtualMachine.java396 VirtualMachine vm; in fromDescriptor() local
399 vm = new VirtualMachine(context, name, config, VirtualizationService.getInstance()); in fromDescriptor()
400 config.serialize(vm.mConfigFilePath); in fromDescriptor()
402 vm.mInstanceFilePath.createNewFile(); in fromDescriptor()
406 vm.importInstanceFrom(vmDescriptor.getInstanceImgFd()); in fromDescriptor()
410 vm.mEncryptedStoreFilePath.createNewFile(); in fromDescriptor()
415 vm.importEncryptedStoreFrom(vmDescriptor.getEncryptedStoreFd()); in fromDescriptor()
418 return vm; in fromDescriptor()
443 VirtualMachine vm = in create() local
445 config.serialize(vm.mConfigFilePath); in create()
[all …]
/packages/modules/Virtualization/tests/testapk/src/java/com/android/microdroid/test/
DMicrodroidTests.java157 VirtualMachine vm = forceCreateNewVirtualMachine("test_vm", config); in createAndConnectToVmHelper() local
162 vm, in createAndConnectToVmHelper()
204 VirtualMachine vm = forceCreateNewVirtualMachine("test_vm", config); in createAndRunNoDebugVm() local
207 runVmTestService(TAG, vm, (ts, tr) -> tr.mAddInteger = ts.addInteger(37, 73)); in createAndRunNoDebugVm()
250 try (VirtualMachine vm = forceCreateNewVirtualMachine("test_vm", config)) { in autoCloseVm() argument
251 assertThat(vm.getStatus()).isEqualTo(STATUS_STOPPED); in autoCloseVm()
255 try (VirtualMachine vm = getVirtualMachineManager().get("test_vm")) { in autoCloseVm() argument
256 vm.run(); in autoCloseVm()
257 assertThat(vm.getStatus()).isEqualTo(STATUS_RUNNING); in autoCloseVm()
261 try (VirtualMachine vm = getVirtualMachineManager().get("test_vm")) { in autoCloseVm() argument
[all …]
/packages/modules/Virtualization/tests/helper/src/java/com/android/microdroid/test/device/
DMicrodroidDeviceTestBase.java217 public void runToFinish(String logTag, VirtualMachine vm) in runToFinish() argument
219 vm.setCallback(mExecutorService, this); in runToFinish()
220 vm.run(); in runToFinish()
221 if (vm.getConfig().isVmOutputCaptured()) { in runToFinish()
223 logTag, vm.getConsoleOutput(), "Console", mConsoleOutput); in runToFinish()
224 logVmOutput(logTag, vm.getLogOutput(), "Log", mLogOutput); in runToFinish()
257 protected void forceStop(VirtualMachine vm) { in forceStop() argument
259 vm.stop(); in forceStop()
266 public void onPayloadStarted(VirtualMachine vm) {} in onPayloadStarted() argument
269 public void onPayloadReady(VirtualMachine vm) {} in onPayloadReady() argument
[all …]
/packages/services/Car/service/jni/evs/
DCarEvsService.cpp153 JavaVM* vm = nullptr; in createServiceHandle() local
154 env->GetJavaVM(&vm); in createServiceHandle()
155 if (vm == nullptr) { in createServiceHandle()
160 return reinterpret_cast<jlong>(EvsServiceContext::create(vm, clazz)); in createServiceHandle()
165 JavaVM* vm = nullptr; in createServiceHandleForTest() local
166 env->GetJavaVM(&vm); in createServiceHandleForTest()
167 if (vm == nullptr) { in createServiceHandleForTest()
173 EvsServiceContext::create(vm, clazz, std::make_unique<MockEvsServiceFactory>(), in createServiceHandleForTest()
204 jint initializeCarEvsService(JavaVM* vm) { in initializeCarEvsService() argument
206 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { in initializeCarEvsService()
DEvsServiceContext.cpp141 EvsServiceContext::EvsServiceContext(JavaVM* vm, JNIEnv* env, jclass clazz, in EvsServiceContext() argument
146 mVm(vm), in EvsServiceContext()
147 mCallbackThread(vm), in EvsServiceContext()
156 EvsServiceContext* EvsServiceContext::create(JavaVM* vm, jclass clazz) { in create() argument
157 return EvsServiceContext::create(vm, clazz, in create()
163 JavaVM* vm, jclass clazz, std::unique_ptr<IEvsServiceFactory> serviceFactory, in create() argument
166 vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_4); in create()
174 return new EvsServiceContext(vm, env, clazz, std::move(serviceFactory), in create()
/packages/modules/Virtualization/vm/
DAndroid.bp6 name: "vm.defaults",
7 crate_name: "vm",
32 name: "vm",
33 defaults: ["vm.defaults"],
40 name: "vm.test",
41 defaults: ["vm.defaults"],
Dvm_shell.sh54 …local available_cids=$(adb shell /apex/com.android.virt/bin/vm list | awk 'BEGIN { FS="[:,]" } /ci…
99 adb shell /apex/com.android.virt/bin/vm run-microdroid "${passthrough_args}" &
104 adb shell /apex/com.android.virt/bin/vm run-microdroid "${passthrough_args}"
/packages/services/Car/service/jni/
DJniLoader.cpp23 extern jint initializeCarEvsService(JavaVM* vm);
29 JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/) { in JNI_OnLoad() argument
31 initializeCarEvsService(vm); in JNI_OnLoad()
36 JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* /*reserved*/) { in JNI_OnUnload() argument
38 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { in JNI_OnUnload()
/packages/modules/Virtualization/virtualizationmanager/src/
Daidl.rs149 for vm in vms { in dump()
150 writeln!(file, "VM CID: {}", vm.cid).or(Err(StatusCode::UNKNOWN_ERROR))?; in dump()
151 writeln!(file, "\tState: {:?}", vm.vm_state.lock().unwrap()) in dump()
153 writeln!(file, "\tPayload state {:?}", vm.payload_state()) in dump()
155 writeln!(file, "\tProtected: {}", vm.protected).or(Err(StatusCode::UNKNOWN_ERROR))?; in dump()
156 writeln!(file, "\ttemporary_directory: {}", vm.temporary_directory.to_string_lossy()) in dump()
158 writeln!(file, "\trequester_uid: {}", vm.requester_uid) in dump()
160 writeln!(file, "\trequester_debug_pid: {}", vm.requester_debug_pid) in dump()
928 fn add_vm(&mut self, vm: Weak<VmInstance>) { in add_vm()
930 self.vms.retain(|vm| vm.strong_count() > 0); in add_vm()
[all …]
/packages/apps/Settings/tests/unit/src/com/android/settings/vpn2/
DVpnUtilsTest.java35 final VpnManager vm = mock(VpnManager.class); in testIsAlwaysOnVpnSet() local
36 when(vm.getAlwaysOnVpnPackageForUser(0)).thenReturn("com.example.vpn"); in testIsAlwaysOnVpnSet()
37 assertThat(VpnUtils.isAlwaysOnVpnSet(vm, 0)).isTrue(); in testIsAlwaysOnVpnSet()
39 when(vm.getAlwaysOnVpnPackageForUser(0)).thenReturn(null); in testIsAlwaysOnVpnSet()
40 assertThat(VpnUtils.isAlwaysOnVpnSet(vm, 0)).isFalse(); in testIsAlwaysOnVpnSet()
/packages/modules/Virtualization/tests/benchmark/src/java/com/android/microdroid/benchmark/
DMicrodroidBenchmarks.java293 VirtualMachine vm = forceCreateNewVirtualMachine(vmName, config); in testVsockTransferFromHostToVM() local
294 BenchmarkVmListener.create(new VsockListener(transferRates, port)).runToFinish(TAG, vm); in testVsockTransferFromHostToVM()
325 VirtualMachine vm = forceCreateNewVirtualMachine(vmName, config); in testVirtioBlkReadRate() local
327 .runToFinish(TAG, vm); in testVirtioBlkReadRate()
354 public void onPayloadReady(VirtualMachine vm, IBenchmarkService benchmarkService) in onPayloadReady() argument
463 VirtualMachine vm = forceCreateNewVirtualMachine(vmName, config); in testMemoryUsage() local
468 BenchmarkVmListener.create(listener).runToFinish(TAG, vm); in testMemoryUsage()
524 public void onPayloadReady(VirtualMachine vm, IBenchmarkService service) in onPayloadReady() argument
548 VirtualMachine vm = forceCreateNewVirtualMachine(vmName, config); in testMemoryReclaim() local
550 BenchmarkVmListener.create(listener).runToFinish(TAG, vm); in testMemoryReclaim()
[all …]
DBenchmarkVmListener.java37 void onPayloadReady(VirtualMachine vm, IBenchmarkService benchmarkService) in onPayloadReady() argument
48 public final void onPayloadReady(VirtualMachine vm) { in onPayloadReady() argument
52 vm.connectToVsockServer(IBenchmarkService.SERVICE_PORT)); in onPayloadReady()
55 mListener.onPayloadReady(vm, benchmarkService); in onPayloadReady()
60 forceStop(vm); in onPayloadReady()
/packages/providers/MediaProvider/jni/
Djni_init.cpp23 int register_android_providers_media_FuseDaemon(JavaVM* vm, JNIEnv* env);
26 extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */) { in JNI_OnLoad() argument
28 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { in JNI_OnLoad()
33 mediaprovider::register_android_providers_media_FuseDaemon(vm, env); in JNI_OnLoad()
/packages/modules/ImsMedia/service/src/com/android/telephony/imsmedia/lib/libimsmedia/
Dlibimsmedia.cpp26 extern jint ImsMediaServiceJni_OnLoad(JavaVM* vm, JNIEnv* env);
28 jint JNI_OnLoad(JavaVM* vm, void* reserved) in JNI_OnLoad() argument
36 if (vm->GetEnv((void**)&env, IMS_MEDIA_JNI_VERSION) != JNI_OK) in JNI_OnLoad()
44 if (ImsMediaServiceJni_OnLoad(vm, env) < 0) in JNI_OnLoad()
/packages/modules/Virtualization/vmclient/src/
Dlib.rs139 pub vm: Strong<dyn IVirtualMachine>, field
185 let vm = service.createVm(config, console.as_ref(), log.as_ref())?; in create() localVariable
187 let cid = vm.getCid()?; in create()
195 vm.registerCallback(&callback)?; in create()
196 let death_recipient = wait_for_binder_death(&mut vm.as_binder(), state.clone())?; in create()
198 Ok(Self { vm, cid, state, _death_recipient: death_recipient }) in create()
203 self.vm.start() in start()
213 self.vm.getState() in state()
258 match self.vm.connectVsock(port as i32) { in connect_service()
/packages/modules/Virtualization/demo/java/com/android/microdroid/demo/
DMainActivity.java170 public void onPayloadStarted(VirtualMachine vm) {} in run()
173 public void onPayloadReady(VirtualMachine vm) { in run()
181 mService.execute(() -> testVmService(vm)); in run()
184 private void testVmService(VirtualMachine vm) { in run()
187 binder = vm.connectToVsockServer(ITestService.SERVICE_PORT); in run()
215 public void onPayloadFinished(VirtualMachine vm, int exitCode) { in run()
225 public void onError(VirtualMachine vm, int errorCode, String message) { in run()
236 public void onStopped(VirtualMachine vm, int reason) { in run()
/packages/modules/Virtualization/javalib/jni/
Dandroid_system_virtualmachine_VirtualMachine.cpp37 auto vm = IVirtualMachine::fromBinder(SpAIBinder{AIBinder_fromJavaBinder(env, vmBinder)}); in Java_android_system_virtualmachine_VirtualMachine_nativeConnectToVsockServer() local
39 std::tuple args{env, vm.get(), port}; in Java_android_system_virtualmachine_VirtualMachine_nativeConnectToVsockServer()
43 auto [env, vm, port] = *static_cast<Args*>(param); in Java_android_system_virtualmachine_VirtualMachine_nativeConnectToVsockServer()
46 if (auto status = vm->connectVsock(port, &fd); !status.isOk()) { in Java_android_system_virtualmachine_VirtualMachine_nativeConnectToVsockServer()
/packages/services/Car/car-evs-helper-lib/jni/
DCarEvsBufferRenderer.cpp75 JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/) { in JNI_OnLoad() argument
77 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { in JNI_OnLoad()
101 JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* /*reserved*/) { in JNI_OnUnload() argument
103 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { in JNI_OnUnload()
/packages/modules/Virtualization/tests/vmshareapp/src/java/com/android/microdroid/test/sharevm/
DVmShareServiceImpl.java111 public void onPayloadStarted(VirtualMachine vm) { in startVm()
116 public void onPayloadReady(VirtualMachine vm) { in startVm()
121 public void onPayloadFinished(VirtualMachine vm, int exitCode) { in startVm()
126 public void onError(VirtualMachine vm, int errorCode, String message) { in startVm()
132 public void onStopped(VirtualMachine vm, int reason) { in startVm()
/packages/modules/Virtualization/docs/getting_started/
Dindex.md102 You can spawn your own VMs by passing a JSON config file to the VirtualizationService via the `vm`
117 adb shell "/apex/com.android.virt/bin/vm run /data/local/tmp/vm_config.json"
120 The `vm` command also has other subcommands for debugging; run `/apex/com.android.virt/bin/vm help`
125 Set system property `hypervisor.pvmfw.path` to custom `pvmfw` on the device before using `vm` tool.
140 adb shell /apex/com.android.virt/bin/vm run-microdroid --debug full
144 `/data/local/tmp/microdroid`, that `vm` will create.
152 adb shell /apex/com.android.virt/bin/vm run-app \
/packages/modules/Virtualization/docs/debug/
Dgdb.md8 You can do this by passing `--gdb <port>` argument to the `vm run`, `vm run-app`
9 and `vm run-microdroid` commands. The `crosvm` will start the gdb server on the
17 adb shell /apex/com.android.virt/bin/vm run-microdroid --gdb 3456
/packages/apps/Nfc/nci/jni/
DNfcJniUtil.h93 JavaVM* vm; member
125 ScopedAttach(JavaVM* vm, JNIEnv** env) : vm_(vm) { in ScopedAttach() argument
/packages/modules/Uwb/service/uci/jni/src/
Ddispatcher.rs51 vm: &'static Arc<JavaVM>, in new()
74 vm, in new()
96 vm: &'static Arc<JavaVM>, in new_dispatcher()
105 let dispatcher = Dispatcher::new(vm, class_loader_obj, callback_obj, chip_ids)?; in new_dispatcher()

1234