From: Stefan Hajnoczi <stefanha@redhat.com>
To: Kashyap Chamarthy <kchamart@redhat.com>
Cc: Eric Blake <eblake@redhat.com>,
qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/4] sockets: add AF_VSOCK support
Date: Mon, 6 Nov 2017 17:12:24 +0000 [thread overview]
Message-ID: <20171106171224.GH4557@stefanha-x1.localdomain> (raw)
In-Reply-To: <20171105185959.fi5xvniqicg7rtiq@eukaryote>
[-- Attachment #1: Type: text/plain, Size: 2063 bytes --]
On Sun, Nov 05, 2017 at 07:59:59PM +0100, Kashyap Chamarthy wrote:
> [Reviving a more than 1-year old thread. I randomly noticed this (refer
> below) while browsing through AF_VSOCK changes in my 'qemu-devel'
> maildir.]
>
> On Tue, Oct 18, 2016 at 11:21:23AM +0100, Stefan Hajnoczi wrote:
> > On Mon, Oct 17, 2016 at 09:25:46AM -0500, Eric Blake wrote:
> > > On 10/16/2016 08:35 AM, Stefan Hajnoczi wrote:
> > >
> > > >>> +
> > > >>> + if (sscanf(str, "%32[^:]:%32[^,]%n", cid, port, &n) != 2) {
> > > >>
> > > >> This says stop at the first comma after the colon...
> > > >>
> > > >>> + error_setg(errp, "error parsing address '%s'", str);
> > > >>> + return NULL;
> > > >>> + }
> > > >>> + if (str[n] != '\0') {
> > > >>> + error_setg(errp, "trailing characters in address '%s'", str);
> > > >>
> > > >> ...but this rejects a trailing comma. Is a trailing comma possible base
> > > >> on how QemuOpts work? If so, do you need to handle it here?
> > > >
> > > > Actually I just wanted to grab characters up until the end of string.
> > > > It wasn't clear from the sscanf(3) man page what the best way to do that
> > > > was, so I kept the comma which is also used in tcp addresses (because
> > > > they support additional comma-separated options).
> > >
> > > %32s instead of %32[^,] should grab up to all 32 remaining characters in
> > > the string; your %n trick then ensures there is no garbage. I guess
> > > it's still a question of whether we want to always treat a comma as
> > > trailing garbage.
> >
> > No comma options are currently accepted. Treating comma as garbage
> > seems okay.
> >
> > Mike: Please change %32[^,] to %32s when merging. Thanks!
>
> The above change didn't take place while merging at that time as part of
> v2.7.0-1720-g6a02c80.
>
> I still see %32[^,] in all the sscanf(3) calls in
> util/util/qemu-sockets.c
>
> Is it still important to change?
Thanks for noticing. I don't think it's necessary to make this change
now.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2017-11-06 17:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 9:00 [Qemu-devel] [PATCH v2 0/4] qga: add vsock-listen Stefan Hajnoczi
2016-10-14 9:00 ` [Qemu-devel] [PATCH v2 1/4] qga: drop unused sockaddr in accept(2) call Stefan Hajnoczi
2016-10-14 9:00 ` [Qemu-devel] [PATCH v2 2/4] qga: drop unnecessary GA_CHANNEL_UNIX_LISTEN checks Stefan Hajnoczi
2016-10-14 9:00 ` [Qemu-devel] [PATCH v2 3/4] sockets: add AF_VSOCK support Stefan Hajnoczi
2016-10-14 14:40 ` Eric Blake
2016-10-16 13:35 ` Stefan Hajnoczi
2016-10-17 14:25 ` Eric Blake
2016-10-18 10:21 ` Stefan Hajnoczi
2017-11-05 18:59 ` Kashyap Chamarthy
2017-11-06 17:12 ` Stefan Hajnoczi [this message]
2016-10-25 23:51 ` Michael Roth
2016-11-01 0:58 ` Michael Roth
2016-10-14 9:00 ` [Qemu-devel] [PATCH v2 4/4] qga: add vsock-listen method Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171106171224.GH4557@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=eblake@redhat.com \
--cc=kchamart@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).