X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Finterfaces%2Fvmm_stream.h;h=4a36e1bedf5f4a9b18b5a8eb8579b9c157cf257b;hb=27268f775ffc99bbea17a47043c2d984c2acf690;hp=e9c49c7034eb5ba8bac71141bc5d1497519b6478;hpb=ef34565873989f5b0240f7f9911c3666a69587c9;p=palacios.git diff --git a/palacios/include/interfaces/vmm_stream.h b/palacios/include/interfaces/vmm_stream.h index e9c49c7..4a36e1b 100644 --- a/palacios/include/interfaces/vmm_stream.h +++ b/palacios/include/interfaces/vmm_stream.h @@ -26,7 +26,11 @@ struct v3_stream { void * host_stream_data; void * guest_stream_data; - uint64_t (*input)(struct v3_stream * stream, uint8_t * buf, uint64_t len); + // 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); }; @@ -37,10 +41,14 @@ struct v3_stream { /* VM Can be NULL */ struct v3_stream * v3_stream_open(struct v3_vm_info * vm, const char * name, - uint64_t (*input)(struct v3_stream * stream, uint8_t * buf, uint64_t len), + sint64_t (*input)(struct v3_stream * stream, uint8_t * buf, sint64_t len), void * guest_stream_data); -uint64_t v3_stream_output(struct v3_stream * stream, uint8_t * buf, uint32_t len); +// 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(struct v3_stream * stream); @@ -49,7 +57,7 @@ void v3_stream_close(struct v3_stream * stream); struct v3_stream_hooks { void *(*open)(struct v3_stream * stream, const char * name, void * host_vm_data); - uint64_t (*output)(struct v3_stream * stream, char * buf, int len); + sint64_t (*output)(struct v3_stream * stream, uint8_t * buf, sint64_t len); void (*close)(struct v3_stream * stream); };