summaryrefslogtreecommitdiffstats
path: root/migration.h
diff options
context:
space:
mode:
authorOrit Wasserman <owasserm@redhat.com>2012-08-06 21:42:52 +0300
committerJuan Quintela <quintela@redhat.com>2012-08-08 13:51:12 +0200
commit302dfbeb21fc5154c24ca50d296e865a3778c7da (patch)
treedc58664ea559e0482b8304d26fdf87aee1b9e1b8 /migration.h
parente6546bb938f5326269b6669d6cbb44d72458caa4 (diff)
downloadhqemu-302dfbeb21fc5154c24ca50d296e865a3778c7da.zip
hqemu-302dfbeb21fc5154c24ca50d296e865a3778c7da.tar.gz
Add xbzrle_encode_buffer and xbzrle_decode_buffer functions
For performance we are encoding long word at a time. For nzrun we use long-word-at-a-time NULL-detection tricks from strcmp(): using ((lword - 0x0101010101010101) & (~lword) & 0x8080808080808080) test to find out if any byte in the long word is zero. Signed-off-by: Benoit Hudzia <benoit.hudzia@sap.com> Signed-off-by: Petter Svard <petters@cs.umu.se> Signed-off-by: Aidan Shribman <aidan.shribman@sap.com> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'migration.h')
-rw-r--r--migration.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/migration.h b/migration.h
index 713aae0..743c366 100644
--- a/migration.h
+++ b/migration.h
@@ -100,4 +100,8 @@ void migrate_add_blocker(Error *reason);
*/
void migrate_del_blocker(Error *reason);
+int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen,
+ uint8_t *dst, int dlen);
+int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t *dst, int dlen);
+
#endif
OpenPOWER on IntegriCloud