qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v1] Make inet_parse() non-static
Date: Wed, 12 Sep 2012 09:05:01 +0530	[thread overview]
Message-ID: <20120912033501.GB13500@in.ibm.com> (raw)
In-Reply-To: <87k3w0pwla.fsf@blackfin.pond.sub.org>

On Tue, Sep 11, 2012 at 02:34:09PM +0200, Markus Armbruster wrote:
> Bharata B Rao <bharata@linux.vnet.ibm.com> writes:
> 
> > From: Bharata B Rao <bharata@linux.vnet.ibm.com>
> >
> > Make inet_parse() non static.
> >
> > - Make inet_parse() non-static so that other subsystems like gluster
> >   can use it to parse inet addresses. As a pre-requisite, define and
> >   globalize the qemu_inet_opts.
> 
> Please repost this as part of a series that needs non-static
> inet_parse().

Sure, will post it as part of next version of gluster patches.

> I'm worried parameter "block" will cause trouble, but I
> can't see that without the users.

I don't see how that could affect the users. FYI I am not using "block"
parameter, pls wait for my next post to check this.

> 
> > - Extend inet_parse() to parse just 'address' also in addition to
> >  'address:port'.
> 
> Separate patch, please.

Hmm ok.

> 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > ---
> > Ideally I needn't use sscanf twice once for parsing host:port (checking
> > return value of 2) and if that fails for parsing host w/o port (checking
> > return value of 1). I could just check if sscanf returned 2 or 1 and decide
> > if addr:port or just addr was provided, but in the latter case the
> > pointer to the bytes consumed (&pos) doesn't get updated.
> 
> You can use two of them, like this:
> 
>     a_end = b_end = -1;
>     sscanf(str, "%d%n:%d%n", &a, &a_end, &b, &b_end);
>     if (b_end >= 0) ...

Thanks.
Bharata.

      reply	other threads:[~2012-09-12  3:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11  8:28 [Qemu-devel] [PATCH v1] Make inet_parse() non-static Bharata B Rao
2012-09-11 12:34 ` Markus Armbruster
2012-09-12  3:35   ` Bharata B Rao [this message]

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=20120912033501.GB13500@in.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).