summary refs log tree commit diff
path: root/vm_control/src
diff options
context:
space:
mode:
Diffstat (limited to 'vm_control/src')
-rw-r--r--vm_control/src/lib.rs21
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
+            ),
+        }
+    }
+}