qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu-sockets: Fix parsing of the inet option 't


From: Lei Li
Subject: Re: [Qemu-devel] [PATCH] qemu-sockets: Fix parsing of the inet option 'to'.
Date: Fri, 09 Nov 2012 10:54:43 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0

On 11/08/2012 11:11 PM, Anthony PERARD wrote:
Having a qemu command line argument like "-vnc 127.0.0.1:0,to=99" is broken.
This have been break with commit 879e45c72da1569e07fbbc6a1aa2a708ea796044.

Signed-off-by: Anthony PERARD <address@hidden>

I have the same problem, and it works on Fedora 16 after this patch.

Tested-by: Lei Li <address@hidden>


---
  qemu-sockets.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/qemu-sockets.c b/qemu-sockets.c
index abcd791..11d3d32 100644
--- a/qemu-sockets.c
+++ b/qemu-sockets.c
@@ -551,8 +551,9 @@ static InetSocketAddress *inet_parse(const char *str, Error 
**errp)
      optstr = str + pos;
      h = strstr(optstr, ",to=");
      if (h) {
-        if (1 != sscanf(str, "%d%n", &to, &pos) ||
-            (str[pos] != '\0' && str[pos] != ',')) {
+        h += 4;
+        if (1 != sscanf(h, "%d%n", &to, &pos) ||
+            (h[pos] != '\0' && h[pos] != ',')) {
              error_setg(errp, "error parsing to= argument");
              goto fail;
          }


--
Lei




reply via email to

[Prev in Thread] Current Thread [Next in Thread]