diff options
author | Zach Reizner <zachr@google.com> | 2019-02-21 20:43:21 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-28 03:24:25 -0800 |
commit | 7898632b42e52109601bc06e7fc380c475430874 (patch) | |
tree | 5d1542b35b6556e4666f6e0b6ba1d9c448c7155f /vm_control | |
parent | a60744b42ee2589e9318029cf3fd7d87fd73f29d (diff) | |
download | crosvm-7898632b42e52109601bc06e7fc380c475430874.tar crosvm-7898632b42e52109601bc06e7fc380c475430874.tar.gz crosvm-7898632b42e52109601bc06e7fc380c475430874.tar.bz2 crosvm-7898632b42e52109601bc06e7fc380c475430874.tar.lz crosvm-7898632b42e52109601bc06e7fc380c475430874.tar.xz crosvm-7898632b42e52109601bc06e7fc380c475430874.tar.zst crosvm-7898632b42e52109601bc06e7fc380c475430874.zip |
main: log responses to command line vm control requests
Now that the connection oriented seqpacket sockets are used for vm control messages, a response can be received by the requested. This change prints out that response. TEST=crosvm suspend|resume|balloon|stop <socket> BUG=chromium:848187 Change-Id: I18ac23c26127332e2be498113cc0c3310fd09a7d Reviewed-on: https://chromium-review.googlesource.com/1482370 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'vm_control')
-rw-r--r-- | vm_control/src/lib.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vm_control/src/lib.rs b/vm_control/src/lib.rs index f0fc209..72531fb 100644 --- a/vm_control/src/lib.rs +++ b/vm_control/src/lib.rs @@ -293,3 +293,24 @@ pub enum VmResponse { desc: GpuMemoryDesc, }, } + +impl Display for VmResponse { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use self::VmResponse::*; + + match self { + Ok => write!(f, "ok"), + Err(e) => write!(f, "error: {}", e), + RegisterMemory { pfn, slot } => write!( + f, + "memory registered to page frame number {:#x} and memory slot {}", + pfn, slot + ), + AllocateAndRegisterGpuMemory { pfn, slot, .. } => write!( + f, + "gpu memory allocated and registered to page frame number {:#x} and memory slot {}", + pfn, slot + ), + } + } +} |