summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorJingkui Wang <jkwang@google.com>2018-10-03 13:04:47 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-11-19 16:28:35 -0800
commite13b180f74ad6d0b1cb1db2a198e294da97e526c (patch)
tree438e0623a7ec0b0583087da9a5214e6008fad2d9 /resources
parentb23c091c8bfd37cab8be15c0912d684187969c63 (diff)
downloadcrosvm-e13b180f74ad6d0b1cb1db2a198e294da97e526c.tar
crosvm-e13b180f74ad6d0b1cb1db2a198e294da97e526c.tar.gz
crosvm-e13b180f74ad6d0b1cb1db2a198e294da97e526c.tar.bz2
crosvm-e13b180f74ad6d0b1cb1db2a198e294da97e526c.tar.lz
crosvm-e13b180f74ad6d0b1cb1db2a198e294da97e526c.tar.xz
crosvm-e13b180f74ad6d0b1cb1db2a198e294da97e526c.tar.zst
crosvm-e13b180f74ad6d0b1cb1db2a198e294da97e526c.zip
crosvm: use msg_socket in vm_control
Refactor existing code to use msg_socket.

BUG=None
TEST=local build and run

Change-Id: Iee72326b330e035303f679e1aedd6e5d18ad4f8a
Reviewed-on: https://chromium-review.googlesource.com/1260260
Commit-Ready: Jingkui Wang <jkwang@google.com>
Tested-by: Jingkui Wang <jkwang@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'resources')
-rw-r--r--resources/Cargo.toml1
-rw-r--r--resources/src/gpu_allocator.rs5
-rw-r--r--resources/src/lib.rs2
3 files changed, 6 insertions, 2 deletions
diff --git a/resources/Cargo.toml b/resources/Cargo.toml
index 29fc38a..c563d20 100644
--- a/resources/Cargo.toml
+++ b/resources/Cargo.toml
@@ -11,3 +11,4 @@ data_model = { path = "../data_model" }
 gpu_buffer = { path = "../gpu_buffer", optional = true }
 libc = "*"
 sys_util = { path = "../sys_util" }
+msg_socket = { path = "../msg_socket" }
diff --git a/resources/src/gpu_allocator.rs b/resources/src/gpu_allocator.rs
index 9f98bcf..16dc944 100644
--- a/resources/src/gpu_allocator.rs
+++ b/resources/src/gpu_allocator.rs
@@ -9,6 +9,7 @@ use libc::EINVAL;
 
 #[cfg(feature = "wl-dmabuf")]
 use gpu_buffer;
+use msg_socket::MsgOnSocket;
 use sys_util;
 
 #[derive(Debug)]
@@ -18,14 +19,14 @@ pub enum GpuAllocatorError {
 }
 
 /// Struct that describes the offset and stride of a plane located in GPU memory.
-#[derive(Clone, Copy, Debug, PartialEq, Default)]
+#[derive(Clone, Copy, Debug, PartialEq, Default, MsgOnSocket)]
 pub struct GpuMemoryPlaneDesc {
     pub stride: u32,
     pub offset: u32,
 }
 
 /// Struct that describes a GPU memory allocation that consists of up to 3 planes.
-#[derive(Clone, Copy, Debug, Default)]
+#[derive(Clone, Copy, Debug, Default, MsgOnSocket)]
 pub struct GpuMemoryDesc {
     pub planes: [GpuMemoryPlaneDesc; 3],
 }
diff --git a/resources/src/lib.rs b/resources/src/lib.rs
index 5d12cfc..e19ac7c 100644
--- a/resources/src/lib.rs
+++ b/resources/src/lib.rs
@@ -8,6 +8,8 @@
 extern crate gpu_buffer;
 extern crate libc;
 extern crate sys_util;
+#[macro_use]
+extern crate msg_socket;
 
 mod address_allocator;
 mod gpu_allocator;