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.


New keyed stream interface
Peter Dinda [Wed, 26 Dec 2012 17:07:44 +0000 (11:07 -0600)]
palacios/include/interfaces/vmm_keyed_stream.h
palacios/src/interfaces/Kconfig
palacios/src/interfaces/vmm_keyed_stream.c

index d9a9eea..1328e4f 100644 (file)
@@ -31,6 +31,9 @@
 
   If you open a key for reading, you get the read pointer set to its beginning.   
   You can then make repeated reads to advance the read pointer.  You cannot seek.
+  Reading is done with a tag supplied, and we will match the requested tag
+  against the actual tag.  If they do not match, we immediately return
+  with an error.
 
   Writing works similarly.
 
@@ -54,15 +57,21 @@ v3_keyed_stream_key_t v3_keyed_stream_open_key(v3_keyed_stream_t stream, char *k
 void                  v3_keyed_stream_close_key(v3_keyed_stream_t stream,  char *key);
 sint64_t              v3_keyed_stream_write_key(v3_keyed_stream_t stream,  
                                                v3_keyed_stream_key_t key,
+                                               void *tag,
+                                               sint64_t taglen,
                                                void *buf, 
                                                sint64_t len);
 sint64_t              v3_keyed_stream_read_key(v3_keyed_stream_t stream,
                                               v3_keyed_stream_key_t key,
+                                              void *tag,
+                                              sint64_t taglen,
                                               void *buf, 
                                               sint64_t len);
 
 
 
+/* We will kill this stuff since it's now in the interface 
+
 #define STD_SAVE_RAW(stream,ks,x)                      \
     do { \
        if (sizeof((x)) != v3_keyed_stream_write_key((stream), (ks), &(x), sizeof((x)))) { \
@@ -82,6 +91,7 @@ sint64_t              v3_keyed_stream_read_key(v3_keyed_stream_t stream,
 
 #define KSTREAM_MAGIC_COOKIE 0xabcd0123
 
+
 #define STD_SAVE_TAGGED(stream,ks,tag,size,x)                          \
 do {                                                                   \
 uint32_t temp;                                                         \
@@ -162,6 +172,9 @@ if ((size) != v3_keyed_stream_read_key((stream),(ks),&(x),(size))) {        \
 #define STD_LOAD(stream,ks,x) STD_LOAD_RAW(stream,ks,x)
 #endif
 
+*/
+
+#endif
 
 
 struct v3_keyed_stream_hooks {
@@ -184,11 +197,15 @@ struct v3_keyed_stream_hooks {
 
     sint64_t (*write_key)(v3_keyed_stream_t stream,
                          v3_keyed_stream_key_t key,
+                         void *tag,
+                         sint64_t taglen,
                          void *buf, 
                          sint64_t len);
 
     sint64_t (*read_key)(v3_keyed_stream_t stream,
                         v3_keyed_stream_key_t key,
+                        void *tag,
+                        sint64_t taglen,
                         void *buf, 
                         sint64_t len);
     
index 6553f40..5f86790 100644 (file)
@@ -13,16 +13,6 @@ config KEYED_STREAMS
           Select this if your host OS supports keyed streams
           Palacios Checkpoint/Restore and Migration depends on this feature
 
-config KEYED_STREAMS_WITH_TAGS
-       bool "Keyed streams will be written in verbose tagged style when std save/load macros are in use"
-       default n
-        depends on KEYED_STREAMS
-       help
-          Select this if you want the standard save and load macros
-          (STD_SAVE, STD_LOAD) to write to streams in the format:
-          [magic cookie][tag len][tag][data len][data] instead of the
-          default format of [data]
-
 config STREAM
        bool "Stream support"
        default n
index 79d69ac..45d8d20 100644 (file)
@@ -74,24 +74,28 @@ void                  v3_keyed_stream_close_key(v3_keyed_stream_t stream,  char
 
 sint64_t              v3_keyed_stream_write_key(v3_keyed_stream_t stream,  
                                                v3_keyed_stream_key_t key,
+                                               void *tag,
+                                               sint64_t taglen,
                                                void *buf, 
                                                sint64_t len)
 {
     V3_ASSERT(keyed_stream_hooks != NULL);
     V3_ASSERT(keyed_stream_hooks->write_key != NULL);
 
-    return keyed_stream_hooks->write_key(stream,key,buf,len);
+    return keyed_stream_hooks->write_key(stream,key,tag,taglen,buf,len);
 }
 
 sint64_t              v3_keyed_stream_read_key(v3_keyed_stream_t stream,
                                               v3_keyed_stream_key_t key,
+                                              void *tag,
+                                              sint64_t taglen,
                                               void *buf, 
                                               sint64_t len)
 {
     V3_ASSERT(keyed_stream_hooks != NULL);
     V3_ASSERT(keyed_stream_hooks->read_key != NULL);
 
-    return keyed_stream_hooks->read_key(stream,key,buf,len);
+    return keyed_stream_hooks->read_key(stream,key,tag,taglen,buf,len);
 }