xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>, Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH] tools/toollog: Drop XTL_NEW_LOGGER()
Date: Tue, 19 Jan 2016 17:04:51 +0000	[thread overview]
Message-ID: <1453223091.26343.12.camel@citrix.com> (raw)
In-Reply-To: <569E66F8.2020407@citrix.com>

On Tue, 2016-01-19 at 16:40 +0000, Andrew Cooper wrote:
> On 19/01/16 16:24, Ian Campbell wrote:
> > On Thu, 2016-01-14 at 20:13 +0000, Andrew Cooper wrote:
> > > XTL_NEW_LOGGER() makes a number of unreasonable assumptions about the
> > > symbols
> > > visible in its scope,
> > It assumes that the function names to fill in the vtable and the type
> > name
> > are related, that hardly seems totally "unreasonable". What else does
> > it
> > assume that makes it unreasonable?
> 
> We have already had this argument once, the result being "patch
> welcome".  Here one is.
> 
> Not only does it assume certain names, it is tokenised with a magic 3rd
> identifier.
> 
> It also assumes the presence of a structure member named vtable.

The underlying issue with all of these is the _undocumented_ nature of the
assumptions, which is certainly a bug, however those assumptions are not in
themselves "unreasonable" as was claimed.

> > I think if you intend to remove something on this basis you need to be
> > specific about what you believe the short comings are.
> 
> GNUism in header file claiming C99 strictness
> 
> If vtable isn't the first element in the structure, it follows a wild
> pointer on error.

Thank you. Both of these and the lack of documentation should have been
spelled out in the original commit message as reasons for the removal.

> > >  and as such is only usable by its sole caller.
> > "not usable by every imaginable caller" is not the same as "usable by
> > one
> > single possible caller", I think you are overstating the case here.
> 
> It is genuinely harder to reverse engineer how to use that macro than to
> opencode a sane alternative.

A consequence of the lack of documentation rather than any inherent
unreasonableness of the provision of such a helper.

BTW your patch removes the logging on failure to allocate, which should
either be fixed or called out in the commit message.

> I stand firmly by my statement.

You might reasonably stand by your actual reasons for removing this macro,
but the original commit message didn't contain them.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-01-19 17:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 20:13 [PATCH] tools/toollog: Drop XTL_NEW_LOGGER() Andrew Cooper
2016-01-19  9:46 ` Wei Liu
2016-01-19 16:24 ` Ian Campbell
2016-01-19 16:40   ` Andrew Cooper
2016-01-19 17:04     ` Ian Campbell [this message]
2016-01-19 17:15       ` Ian Jackson
2016-01-19 17:18         ` Ian Jackson
2016-01-19 17:36         ` Ian Jackson
2016-01-19 17:45           ` Andrew Cooper
2016-01-19 17:58             ` Ian Jackson
2016-01-20 17:21               ` Ian Campbell

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=1453223091.26343.12.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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).