summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Snow2015-05-22 20:13:44 +0200
committerJohn Snow2015-05-22 21:58:22 +0200
commit4d00796364ec4edab86b08abc38fd644d5e3c0ad (patch)
treeef35c4260437568add05037ee7a004fc2bc49162 /tests
parentqtest: Add base64 encoded read/write (diff)
downloadqemu-4d00796364ec4edab86b08abc38fd644d5e3c0ad.tar.gz
qemu-4d00796364ec4edab86b08abc38fd644d5e3c0ad.tar.xz
qemu-4d00796364ec4edab86b08abc38fd644d5e3c0ad.zip
qtest: add memset to qtest protocol
Previously, memset was just a frontend to write() and only stupidly sent the pattern many times across the wire. Let's not discuss who stupidly wrote it like that in the first place. (Hint: It was me.) Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1430864578-22072-4-git-send-email-jsnow@redhat.com
Diffstat (limited to 'tests')
-rw-r--r--tests/libqtest.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 5f57005447..055aad69e0 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -741,13 +741,7 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size)
void qtest_memset(QTestState *s, uint64_t addr, uint8_t pattern, size_t size)
{
- size_t i;
-
- qtest_sendf(s, "write 0x%" PRIx64 " 0x%zx 0x", addr, size);
- for (i = 0; i < size; i++) {
- qtest_sendf(s, "%02x", pattern);
- }
- qtest_sendf(s, "\n");
+ qtest_sendf(s, "memset 0x%" PRIx64 " 0x%zx 0x%02x\n", addr, size, pattern);
qtest_rsp(s, 0);
}