diff options
author | Jason Macnak <natsu@google.com> | 2024-04-29 12:42:20 -0700 |
---|---|---|
committer | Jason Macnak <natsu@google.com> | 2024-04-29 14:32:57 -0700 |
commit | 20e2971d4507345a9af69b9012f86a561944eb8f (patch) | |
tree | 7010c1db4278f4f07546da757ef9d5621bf7591c | |
parent | bfb414a562d2e65a87220f9d8287c779e24dfe14 (diff) | |
download | cuttlefish-20e2971d4507345a9af69b9012f86a561944eb8f.tar.gz |
Update qemu_manager to read RIL settings from CuttlefishConfig
... in order to remove vm_manager's dependency on device config.
Bug: b/261231681
Test: build
Change-Id: Ib1b86a74f57a207e8b57e3012a56ba56054bfb6c
-rw-r--r-- | host/libs/vm_manager/Android.bp | 2 | ||||
-rw-r--r-- | host/libs/vm_manager/qemu_manager.cpp | 16 |
2 files changed, 3 insertions, 15 deletions
diff --git a/host/libs/vm_manager/Android.bp b/host/libs/vm_manager/Android.bp index 3325e6544..7cd03297f 100644 --- a/host/libs/vm_manager/Android.bp +++ b/host/libs/vm_manager/Android.bp @@ -33,8 +33,6 @@ cc_library { shared_libs: [ "libbase", "libcuttlefish_command_util", - "libcuttlefish_device_config", - "libcuttlefish_device_config_proto", "libcuttlefish_fs", "libcuttlefish_utils", "libfruit", diff --git a/host/libs/vm_manager/qemu_manager.cpp b/host/libs/vm_manager/qemu_manager.cpp index 0f300d41d..332023d77 100644 --- a/host/libs/vm_manager/qemu_manager.cpp +++ b/host/libs/vm_manager/qemu_manager.cpp @@ -35,7 +35,6 @@ #include <android-base/logging.h> #include <vulkan/vulkan.h> -#include "common/libs/device_config/device_config.h" #include "common/libs/utils/files.h" #include "common/libs/utils/result.h" #include "common/libs/utils/subprocess.h" @@ -729,18 +728,9 @@ Result<std::vector<MonitorCommand>> QemuManager::StartCommands( } break; case cuttlefish::ExternalNetworkMode::kSlirp: { - // TODO(schuffelen): Deduplicate with modem_simulator/cf_device_config.cpp - // The configuration here needs to match the ip address reported by the - // modem simulator, which the guest uses to statically assign an IP - // address to its virtio-net ethernet device. - std::string net = "10.0.2.15/24"; - std::string host = "10.0.2.2"; - auto device_config_helper = DeviceConfigHelper::Get(); - if (device_config_helper) { - const auto& cfg = device_config_helper->GetDeviceConfig().ril_config(); - net = fmt::format("{}/{}", cfg.ipaddr(), cfg.prefixlen()); - host = cfg.gateway(); - } + const std::string net = + fmt::format("{}/{}", instance.ril_ipaddr(), instance.ril_prefixlen()); + const std::string& host = instance.ril_gateway(); qemu_cmd.AddParameter("-netdev"); // TODO(schuffelen): `dns` needs to match the first `nameserver` in // `/etc/resolv.conf`. Implement something that generalizes beyond gLinux. |