From: Ian Campbell <ian.campbell@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 0/4] xl: consolidate adhoc parsers
Date: Mon, 25 Jan 2016 12:25:53 +0000 [thread overview]
Message-ID: <1453724753.4320.143.camel@citrix.com> (raw)
In-Reply-To: <1453463454-4114-1-git-send-email-wei.liu2@citrix.com>
On Fri, 2016-01-22 at 11:50 +0000, Wei Liu wrote:
> This patch series consolidates adhoc parsers in xl.
>
> There are currently 4 types of devices:
>
> 1. block
> 2. netowrk
> 3. vtpm
> 4. pci
>
> that support hotplug as well as being specified in config file.
>
> Block and pci devices are fine because they use libxlu to parse
> configuration strings.
>
> Network and vtpms config parsers are not in a very good state, which
> need to be consolidated.
>
> Note that there is code repetition in the newly introduced parser
> code. We either need to have very long macro definition or code
> repetition. I chose the latter. Let me know your opinion.
You could make it take function pointers by using void * to point to the
objects. There's a (small) risk of mismatching the point and the callback,
but not significant enough to worry about IMHO.
That said, when I mentioned helpers originally I was imagining they would
parse their input into a data structure containing (in some form or other)
a list of key value pairs (taking into account the behaviour desired on
duplication of keys etc) which the callers would use opaquely up front and
then iterate over the results in some way (either a foreach helper macro,
or first() and next() type helpers etc).
Ian.
next prev parent reply other threads:[~2016-01-25 12:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-22 11:50 [PATCH 0/4] xl: consolidate adhoc parsers Wei Liu
2016-01-22 11:50 ` [PATCH 1/4] xl: remove unused macros Wei Liu
2016-01-25 12:17 ` Ian Campbell
2016-01-22 11:50 ` [PATCH 2/4] xl: wrap long lines where possible Wei Liu
2016-01-25 12:17 ` Ian Campbell
2016-01-22 11:50 ` [PATCH 3/4] xl: rework vif config parsing code Wei Liu
2016-01-22 11:50 ` [PATCH 4/4] xl: rework vtpm " Wei Liu
2016-01-25 12:25 ` Ian Campbell [this message]
2016-02-16 22:09 ` [PATCH 0/4] xl: consolidate adhoc parsers Jim Fehlig
2016-02-16 23:20 ` Wei Liu
2016-02-17 10:01 ` Ian Campbell
2016-02-17 12:00 ` Wei Liu
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=1453724753.4320.143.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.