From 53edb817dac31c549464040339a16be3a52e3f74 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Wed, 22 May 2019 08:57:16 -0700 Subject: crosvm: {WlDriverRequest, WlDriverResponse} --> {VmMemoryRequest, VmMemoryResponse} These type of requests are not necessarily specific to the virtio-wl, and other devices (virtio-gpu) may want to use them. BUG=chromium:924405 TEST=compile Change-Id: Iad0889da8ab3d23bb2378448fc05e3c840a93d93 Reviewed-on: https://chromium-review.googlesource.com/1626791 Commit-Ready: ChromeOS CL Exonerator Bot Tested-by: kokoro Legacy-Commit-Queue: Commit Bot Reviewed-by: Zach Reizner --- src/linux.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/linux.rs') diff --git a/src/linux.rs b/src/linux.rs index 979666e..58a0667 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -48,8 +48,8 @@ use vhost; use vm_control::{ BalloonControlCommand, BalloonControlRequestSocket, BalloonControlResponseSocket, DiskControlCommand, DiskControlRequestSocket, DiskControlResponseSocket, DiskControlResult, - UsbControlSocket, VmControlResponseSocket, VmRunMode, WlControlRequestSocket, - WlControlResponseSocket, WlDriverRequest, WlDriverResponse, + UsbControlSocket, VmControlResponseSocket, VmMemoryControlRequestSocket, + VmMemoryControlResponseSocket, VmMemoryRequest, VmMemoryResponse, VmRunMode, }; use crate::{Config, DiskOption, TouchDeviceOption}; @@ -235,7 +235,7 @@ type Result = std::result::Result; enum TaggedControlSocket { Vm(VmControlResponseSocket), - Wayland(WlControlResponseSocket), + VmMemory(VmMemoryControlResponseSocket), } impl AsRef for TaggedControlSocket { @@ -243,7 +243,7 @@ impl AsRef for TaggedControlSocket { use self::TaggedControlSocket::*; match &self { Vm(ref socket) => socket, - Wayland(ref socket) => socket, + VmMemory(ref socket) => socket, } } } @@ -596,7 +596,7 @@ fn create_gpu_device( fn create_wayland_device( cfg: &Config, socket_path: &Path, - socket: WlControlRequestSocket, + socket: VmMemoryControlRequestSocket, resource_bridge: Option, ) -> DeviceResult { let wayland_socket_dir = socket_path.parent().ok_or(Error::InvalidWaylandPath)?; @@ -692,7 +692,7 @@ fn create_virtio_devices( cfg: &Config, mem: &GuestMemory, _exit_evt: &EventFd, - wayland_device_socket: WlControlRequestSocket, + wayland_device_socket: VmMemoryControlRequestSocket, balloon_device_socket: BalloonControlResponseSocket, disk_device_sockets: &mut Vec, ) -> DeviceResult> { @@ -792,7 +792,7 @@ fn create_devices( cfg: &Config, mem: &GuestMemory, exit_evt: &EventFd, - wayland_device_socket: WlControlRequestSocket, + wayland_device_socket: VmMemoryControlRequestSocket, balloon_device_socket: BalloonControlResponseSocket, disk_device_sockets: &mut Vec, usb_provider: HostBackendDeviceProvider, @@ -1161,8 +1161,8 @@ pub fn run_config(cfg: Config) -> Result<()> { let mut control_sockets = Vec::new(); let (wayland_host_socket, wayland_device_socket) = - msg_socket::pair::().map_err(Error::CreateSocket)?; - control_sockets.push(TaggedControlSocket::Wayland(wayland_host_socket)); + msg_socket::pair::().map_err(Error::CreateSocket)?; + control_sockets.push(TaggedControlSocket::VmMemory(wayland_host_socket)); // Balloon gets a special socket so balloon requests can be forwarded from the main process. let (balloon_host_socket, balloon_device_socket) = msg_socket::pair::().map_err(Error::CreateSocket)?; @@ -1569,19 +1569,19 @@ fn run_control( } } }, - TaggedControlSocket::Wayland(socket) => match socket.recv() { + TaggedControlSocket::VmMemory(socket) => match socket.recv() { Ok(request) => { let response = request.execute(&mut linux.vm, &mut linux.resources); if let Err(e) = socket.send(&response) { - error!("failed to send WlControlResponse: {}", e); + error!("failed to send VmMemoryControlResponse: {}", e); } } Err(e) => { if let MsgError::BadRecvSize { actual: 0, .. } = e { vm_control_indices_to_remove.push(index); } else { - error!("failed to recv WlControlRequest: {}", e); + error!("failed to recv VmMemoryControlRequest: {}", e); } } }, -- cgit 1.4.1