qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qtest: Handle addresses and values for {in, out}[bwl] as unsigned
@ 2013-04-21 13:30 Peter Maydell
  2013-04-21 15:24 ` Blue Swirl
  2013-04-22 18:34 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2013-04-21 13:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Blue Swirl, Anthony Liguori, patches

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 <peter.maydell@linaro.org>
---
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);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qtest: Handle addresses and values for {in, out}[bwl] as unsigned
  2013-04-21 13:30 [Qemu-devel] [PATCH] qtest: Handle addresses and values for {in, out}[bwl] as unsigned Peter Maydell
@ 2013-04-21 15:24 ` Blue Swirl
  2013-04-22 18:34 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Blue Swirl @ 2013-04-21 15:24 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-trivial, Anthony Liguori, qemu-devel, patches

On Sun, Apr 21, 2013 at 1:30 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> 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 <peter.maydell@linaro.org>

Fixes the problem for me.
Tested-by: Blue Swirl <blauwirbel@gmail.com>

> ---
> 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);
> --
> 1.7.10.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qtest: Handle addresses and values for {in, out}[bwl] as unsigned
  2013-04-21 13:30 [Qemu-devel] [PATCH] qtest: Handle addresses and values for {in, out}[bwl] as unsigned Peter Maydell
  2013-04-21 15:24 ` Blue Swirl
@ 2013-04-22 18:34 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2013-04-22 18:34 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: qemu-trivial, Blue Swirl, Anthony Liguori, patches

Applied.  Thanks.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-22 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-21 13:30 [Qemu-devel] [PATCH] qtest: Handle addresses and values for {in, out}[bwl] as unsigned Peter Maydell
2013-04-21 15:24 ` Blue Swirl
2013-04-22 18:34 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).