From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWel5-0002WY-Cj for qemu-devel@nongnu.org; Thu, 08 Nov 2012 21:55:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWel4-0001ui-AY for qemu-devel@nongnu.org; Thu, 08 Nov 2012 21:55:51 -0500 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:52048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWel3-0001tm-Jf for qemu-devel@nongnu.org; Thu, 08 Nov 2012 21:55:50 -0500 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Nov 2012 08:25:42 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qA92tdsT11993178 for ; Fri, 9 Nov 2012 08:25:40 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qA98O2tb005279 for ; Fri, 9 Nov 2012 19:24:03 +1100 Message-ID: <509C7073.3050605@linux.vnet.ibm.com> Date: Fri, 09 Nov 2012 10:54:43 +0800 From: Lei Li MIME-Version: 1.0 References: <1352387501-21907-1-git-send-email-anthony.perard@citrix.com> In-Reply-To: <1352387501-21907-1-git-send-email-anthony.perard@citrix.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-sockets: Fix parsing of the inet option 'to'. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony PERARD Cc: Paolo Bonzini , QEMU-devel , Luiz Capitulino 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 I have the same problem, and it works on Fedora 16 after this patch. Tested-by: Lei Li > > --- > 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