[libvirt] [PATCH 03/10] conf: domaincaps: Fix broken attempt at being const-correct

Ján Tomko jtomko at redhat.com
Tue Nov 12 13:30:54 UTC 2019


On Tue, Nov 12, 2019 at 09:30:14AM +0000, Daniel P. Berrangé wrote:
>On Tue, Nov 12, 2019 at 08:27:40AM +0100, Peter Krempa wrote:
>> 'virBlahPtr const blah' results into modification to the value of 'blah'
>> triggering compilation error rather than the modification of the virBlah
>> struct the pointer points to.
>
>Shall we add a syntax check rule to forbid "virFOOPtr const", and
>"const virFOOPtr".
>

We already do have a rule against const virFOOPtr.

Jano

>Indeed, I rather wish we never had the "Ptr" suffix at all, and
>just used a "*" normally, but that would be a too huge change.
>
>>
>> All of the domain capability formatting code was broken in this regard.
>>
>> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>> ---
>>  src/conf/domain_capabilities.c | 32 ++++++++++++++++----------------
>>  src/conf/domain_capabilities.h |  4 ++--
>>  2 files changed, 18 insertions(+), 18 deletions(-)
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20191112/37e80546/attachment-0001.sig>


More information about the libvir-list mailing list