From patchwork Sun Apr 21 13:30:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 16282 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6740820F45 for ; Sun, 21 Apr 2013 13:30:53 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id v20sf8668673qcm.5 for ; Sun, 21 Apr 2013 06:30:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=zbArhIbkol9YIM+t/ZELGfm4YoYRWYc++TPAm5A0XRU=; b=Fsx0rM42VxWPt4O6S9+RFEoE2SA5SqEOBziGbxnrhpRy395X52OxctzhtAE13r3aPa Ve9tnDTnpPEGLID++fSrWgbbIA8XRb597AVSYJkz4P5ssJIRP2nKLIngn0C40++a3gQe mwv5rMJhnfX3lWzUYwR0Xf1pAsCcntCYSk3ZBh+21pJHcN5kAnc8vYHZSiLEBxSKjT4i jYbibqp9gVyXY98Lw4BRuUmhLezv1Due//dobx33wu5J0KtaYeolDZLvYKgSgeF2jFyB b80nme8e7B7Yc8v9F8JOnFrRQfruqn1I/xEgzwZ3mPktb+UTVTEkWVCwxj9QDlu3fKUK JRMA== X-Received: by 10.224.217.195 with SMTP id hn3mr16889224qab.5.1366551009208; Sun, 21 Apr 2013 06:30:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.40 with SMTP id 8ls930605qeb.65.gmail; Sun, 21 Apr 2013 06:30:09 -0700 (PDT) X-Received: by 10.58.220.129 with SMTP id pw1mr16638465vec.32.1366551008992; Sun, 21 Apr 2013 06:30:08 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id ij9si13989681vdb.30.2013.04.21.06.30.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Apr 2013 06:30:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hx10so24658vcb.17 for ; Sun, 21 Apr 2013 06:30:08 -0700 (PDT) X-Received: by 10.52.163.231 with SMTP id yl7mr14066170vdb.57.1366551008607; Sun, 21 Apr 2013 06:30:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp41442veb; Sun, 21 Apr 2013 06:30:08 -0700 (PDT) X-Received: by 10.180.108.176 with SMTP id hl16mr38817841wib.25.1366551007449; Sun, 21 Apr 2013 06:30:07 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id iy13si3521640wic.31.2013.04.21.06.30.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 21 Apr 2013 06:30:07 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UTuLD-0004Ky-Hh; Sun, 21 Apr 2013 14:30:03 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org, Anthony Liguori , Blue Swirl Subject: [PATCH] qtest: Handle addresses and values for {in, out}[bwl] as unsigned Date: Sun, 21 Apr 2013 14:30:03 +0100 Message-Id: <1366551003-16649-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQl/FAMPLBNLSA7e6w11INglELnVq83ALurEB3Ntg4fatXUAFH9XlJnYyrqroCiJdyJGC8kM X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Handle the addresses and values for {in,out}[bwl] as unsigned (ie with strtoul), as per the protocol specification comment. This fixes a test failure in test_i440fx_defaults on 32-bit hosts where the test tries to write 0x80000000 and qtest was instead writing 0x7fffffff. Signed-off-by: Peter Maydell Tested-by: Blue Swirl --- This fixes the actual parsing error; checking strtol errors is a separate bug which should be done for the whole file. qtest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qtest.c b/qtest.c index 3bba3e5..07a9612 100644 --- a/qtest.c +++ b/qtest.c @@ -271,8 +271,8 @@ static void qtest_process_command(CharDriverState *chr, gchar **words) uint32_t value; g_assert(words[1] && words[2]); - addr = strtol(words[1], NULL, 0); - value = strtol(words[2], NULL, 0); + addr = strtoul(words[1], NULL, 0); + value = strtoul(words[2], NULL, 0); if (words[0][3] == 'b') { cpu_outb(addr, value); @@ -290,7 +290,7 @@ static void qtest_process_command(CharDriverState *chr, gchar **words) uint32_t value = -1U; g_assert(words[1]); - addr = strtol(words[1], NULL, 0); + addr = strtoul(words[1], NULL, 0); if (words[0][2] == 'b') { value = cpu_inb(addr);