Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


pci_front bugfix - do not propagate cmd reg write twice
[palacios.git] / palacios / include / interfaces / vmm_stream.h
index 513cf73..4a36e1b 100644 (file)
 
 
 
+struct v3_stream {
+    void * host_stream_data;
+    void * guest_stream_data;
+  // the semantics are:
+  // negative return = error
+  // zero return = would block
+  // otherwise = amount of data transfered
+    sint64_t (*input)(struct v3_stream * stream, uint8_t * buf, sint64_t len);
+};
+
+
 #ifdef __V3VEE__
 #include <palacios/vmm.h>
 
-typedef void * v3_stream_t;
+
 
 /* VM Can be NULL */
-v3_stream_t v3_stream_open(struct v3_vm_info * vm, const char * name);
-int v3_stream_write(v3_stream_t stream, uint8_t * buf, uint32_t len);
+struct v3_stream * v3_stream_open(struct v3_vm_info * vm, const char * name,
+                                 sint64_t (*input)(struct v3_stream * stream, uint8_t * buf, sint64_t len),
+                                 void * guest_stream_data);
+
+// the semantics are:
+// negative return = error
+// zero return = would block
+// otherwise = amount of data transfered
+sint64_t  v3_stream_output(struct v3_stream * stream, uint8_t * buf, sint64_t len);
 
-void v3_stream_close(v3_stream_t stream);
+void v3_stream_close(struct v3_stream * stream);
 
 #endif
 
 
 struct v3_stream_hooks {
-    void *(*open)(const char * name, void * private_data);
-    int (*write)(void * stream, char * buf, int len);
-    void (*close)(void * stream);
+    void *(*open)(struct v3_stream * stream, const char * name, void * host_vm_data);
+    sint64_t (*output)(struct v3_stream * stream, uint8_t * buf, sint64_t len);
+    void (*close)(struct v3_stream * stream);
 };