[libvirt] [PATCH 00/15] fix misuse of 'const fooPtr'

Eric Blake eblake at redhat.com
Wed Oct 9 12:49:43 UTC 2013


On 10/09/2013 03:27 AM, Daniel P. Berrange wrote:
> On Tue, Oct 08, 2013 at 11:24:57AM -0600, Eric Blake wrote:
>> Mostly cleanup, but at least one bug fix (xen was instantiating
>> a memballoon device too early, during the post-parse callback
>> of the first device rather than after all devices were known).
>>
>> Spawned by the conversation here:
>> https://www.redhat.com/archives/libvir-list/2013-September/thread.html#01311
> 
> If we're going down the route of removing 'Ptr' suffixes in favour
> of normal '*' where we need to have const, how about just doing
> away with this 'Ptr' suffix *everywhere* (well except public header
> where we'd need to keep the typedef for back compat). Internally
> we could completely remove it though.  The 'Ptr' typedefs actually
> may the code longer, for no obvious benefit, and create problems
> with const-ness.
> 
> The main problem is that the huge change would create pain for people
> backporting patches.

Indeed, which is why I limited things to JUST the case where the syntax
checker proved we were using the wrong type.  A bigger cleanup to remove
Ptr may be entirely mechanical, but it does make backports interesting.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131009/1349086b/attachment-0001.sig>


More information about the libvir-list mailing list