From: George Dunlap <george.dunlap@eu.citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Hanweidong <hanweidong@huawei.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH] libxl, hvmloader: Don't relocate memory for MMIO hole
Date: Tue, 18 Jun 2013 12:43:24 +0100 [thread overview]
Message-ID: <51C047DC.6090609@eu.citrix.com> (raw)
In-Reply-To: <20928.15411.508151.115188@mariner.uk.xensource.com>
On 06/18/2013 11:53 AM, Ian Jackson wrote:
> George Dunlap writes ("Re: [PATCH] libxl,hvmloader: Don't relocate memory for MMIO hole"):
>> On 06/17/2013 06:15 PM, Ian Jackson wrote:
>>> I think the approach is good. Arguably the two things should be in
>>> two patches.
>>
>> You mean one in libxl to set allow_memory_relocate, one to do something
>> about it?
>
> No. I mean one to do the thing with allow_memory_relocate and one to
> change the condition on bar64_relocate. But maybe I have
> misunderstood and that doesn't make sense. Anyway, it's OK IMO as one
> patch.
Yes, I was thinking that if we were breaking down the patches, that
might be a candidate for a separate patch. Why don't I do that anyway.
>
>>>> + s = xenstore_read(HVM_XS_ALLOW_MEMORY_RELOCATE, NULL);
>>>> + if (s)
>>>> + allow_memory_relocate=(uint8_t)strtoll(s, NULL, 0);
>>>
>>> Use strtoul, surely, and bool_t (or _Bool). Then there is no need for
>>> the cast. (Also, spaces round `='.)
>>
>> Remember that hvmloader doesn't actually have a libc; this is a locally
>> implemented function, and AFAICT the only one implemented is strtoll.
>
> _Bool is a compiler feature and available without the use of
> stdbool.h. It has better semantics than uintblah_t.
We apparently have stdbool.h, but it defines "bool" instead of "bool_t". :-)
>>> Use GCSPRINTF not libxl_sprintf. Lacks error check (check return
>>> value from libxl__xs_write).
>>
>> Once again, I disagree with mixing different code styles in the same
>> function. Using GCSPRINTF and doing an error check here will make it
>> seem like it's doing something different than the line immediately above
>> it (which is what I copied to get here), which will confuse people.
>
> Perhaps we should sweep through libxl sorting out these kind of style
> things in 4.4. Clearly now isn't the time for this kind of wholesale
> change.
>
> In the meantime I think we do want to avoid introducing new code with
> deprecated style.
I'm afraid if that's what you want you're going to have to do it
yourself. I think mixing code style is much worse than having a
consistent, but deprecated code style, and I'm not going to do it.
-George
prev parent reply other threads:[~2013-06-18 11:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 16:43 [PATCH] libxl, hvmloader: Don't relocate memory for MMIO hole George Dunlap
2013-06-17 16:48 ` George Dunlap
2013-06-18 12:18 ` Hanweidong
2013-06-18 12:20 ` George Dunlap
2013-06-18 12:46 ` Hanweidong
2013-06-18 12:51 ` George Dunlap
2013-06-18 12:44 ` George Dunlap
2013-06-18 12:54 ` Hanweidong
2013-06-17 17:02 ` George Dunlap
2013-06-17 17:09 ` Wei Liu
2013-06-17 17:15 ` Ian Jackson
2013-06-18 9:50 ` George Dunlap
2013-06-18 9:57 ` George Dunlap
2013-06-18 10:53 ` Ian Jackson
2013-06-18 11:43 ` George Dunlap [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=51C047DC.6090609@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=hanweidong@huawei.com \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@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 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.