]> git.proxmox.com Git - mirror_qemu.git/commit - qtest.c
qtest: Add base64 encoded read/write
authorJohn Snow <jsnow@redhat.com>
Fri, 22 May 2015 18:13:44 +0000 (14:13 -0400)
committerJohn Snow <jsnow@redhat.com>
Fri, 22 May 2015 19:58:22 +0000 (15:58 -0400)
commit7a6a740d8dcc02f5693315d7935b5de9b963bb96
treea2e267889145f6cff4d1af159684568d19bd16a8
parent332cc7e9b39ddb2feacb4c71dcd18c3e5b0c3147
qtest: Add base64 encoded read/write

For larger pieces of data that won't need to be debugged and
viewing the hex nibbles is unlikely to be useful, we can encode
data using base64 instead of encoding each byte as %02x, which
leads to some space savings and faster reads/writes.

For now, the default is left as hex nibbles in memwrite() and memread().
For the purposes of making qtest io easier to read and debug, some
callers may want to specify using the old encoding format for small
patches of data where the savings from base64 wouldn't be that profound.

memwrite/memread use a data encoding that takes 2x the size of the original
buffer, but base64 uses "only" (4/3)x, so for larger buffers we can save a
decent amount of time and space.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1430864578-22072-3-git-send-email-jsnow@redhat.com
qtest.c
tests/libqtest.c
tests/libqtest.h