From patchwork Mon Apr 23 18:55:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 154525 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 674DAB6F6E for ; Tue, 24 Apr 2012 04:56:30 +1000 (EST) Received: from localhost ([::1]:44249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMOR2-0002a9-Cy for incoming@patchwork.ozlabs.org; Mon, 23 Apr 2012 14:56:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMOQv-0002a2-RG for qemu-devel@nongnu.org; Mon, 23 Apr 2012 14:56:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMOQu-000128-2H for qemu-devel@nongnu.org; Mon, 23 Apr 2012 14:56:21 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:48998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMOQt-00011x-Rz for qemu-devel@nongnu.org; Mon, 23 Apr 2012 14:56:19 -0400 Received: by ghrr14 with SMTP id r14so8290513ghr.4 for ; Mon, 23 Apr 2012 11:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=8+Y3MEnOOhU4x+HlftLAg1p3RNPNJmZE46XKL9LIWr8=; b=UYqbLYypkh3Oqrz3aBi+JwObMx2+zFJmbeKPgWz1LPlK1UcrQnkIYzmRhVmM8gHFIx 8s+FvPB2SnoAbHbejHbjKsZJCZN4oYdA1tRvpPPO2+pa1aB9hqGsoVTiosGk0AREoGn4 MLwISqJQ1zs6F8pAUJQGmLWCCeNFHxhAKt2FgS8a1V+zQCw6szjD3UwMUOIklosfgfDK tcsUhKgZpcsSp+hryuvO9JPc62WZXz8Tw9CEBCN6EDU5oMJRBHGRAKR516wJb7jOeU5P LwVLJaVRsxFDWeZ6ORvhaXjPqtJUCAFK9gikGStx3zoC98saJKc2mcb9B4eWgk3KPdo7 5INA== Received: by 10.50.47.162 with SMTP id e2mr7575689ign.0.1335207377880; Mon, 23 Apr 2012 11:56:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.197.194 with HTTP; Mon, 23 Apr 2012 11:55:57 -0700 (PDT) From: Blue Swirl Date: Mon, 23 Apr 2012 18:55:57 +0000 Message-ID: To: Anthony Liguori , qemu-devel , Gerd Hoffmann X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.173 Subject: [Qemu-devel] [PATCH] qtest: fix memread and memwrite on 32 bit hosts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use PRIx64 to print 64 bit values to avoid truncation on 32 bit hosts. Signed-off-by: Blue Swirl Reviewed-by: Anthony Liguori --- tests/libqtest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) for (i = 0; i < size; i++) { @@ -378,7 +378,7 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size) const uint8_t *ptr = data; size_t i; - qtest_sendf(s, "write 0x%x 0x%x 0x", addr, size); + qtest_sendf(s, "write 0x%" PRIx64 " 0x%x 0x", addr, size); for (i = 0; i < size; i++) { qtest_sendf(s, "%02x", ptr[i]); } diff --git a/tests/libqtest.c b/tests/libqtest.c index d47969e..1ce6fa1 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -356,7 +356,7 @@ void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size) gchar **args; size_t i; - qtest_sendf(s, "read 0x%x 0x%x\n", addr, size); + qtest_sendf(s, "read 0x%" PRIx64 " 0x%x\n", addr, size); args = qtest_rsp(s, 2);