[RFC] qemu: convert DomainLogContext class to use GObject

Ján Tomko jtomko at redhat.com
Tue Mar 10 17:23:42 UTC 2020


On a Tuesday in 2020, Daniel P. Berrangé wrote:
>On Tue, Mar 10, 2020 at 02:02:47PM +0100, Peter Krempa wrote:
>> On Tue, Mar 10, 2020 at 12:53:59 +0000, Daniel Berrange wrote:
>> > On Tue, Mar 10, 2020 at 01:48:39PM +0100, Peter Krempa wrote:
>> > > On Tue, Mar 10, 2020 at 12:42:47 +0000, Daniel Berrange wrote:
>> > > > On Tue, Mar 10, 2020 at 01:33:42PM +0100, Peter Krempa wrote:
>> > > > > On Tue, Mar 10, 2020 at 17:30:01 +0530, Gaurav Agrawal wrote:
>> > > > > > ---
>> > > > > >  src/qemu/qemu_domain.c  | 36 ++++++++++++++++++++----------------
>> > > > > >  src/qemu/qemu_domain.h  |  6 ++++--
>> > > > > >  src/qemu/qemu_process.c |  4 ++--
>> > > > > >  3 files changed, 26 insertions(+), 20 deletions(-)
>>
>> [...]
>>
>> > > > >
>> > > > > There's no reason to break coding style rules in this kind of refactor
>> > > > > nor to make it inconsistent in span of 20 lines.
>> > > >
>> > > > If you're refering to the use of underscores, then this is expected
>> > > > and indeed required because these method names are auto-generated
>> > > > by the GObject macros. This should only be the case for three
>> > > > specific methods (_init, _class_init and _get_type), with the rest
>> > > > all following normal style. See the virIdentity conversion for
>> > > > the prior example of this.
>> > >
>> > > Yeah, I meant mainly that (also the newline after the type).
>> > >
>> > > Can't we at least keep camel-case for the type itself?
>> > >
>> > > 'qemuDomainLogContext_init'
>> > >
>> > > That way at least looking for the symbol name will be less painful.
>> >
>> > We had considered that in the original virIdentity conversion, but
>> > decided mixing two different naming styles in one identifier was
>> > even more ugly.
>>
>> While ugly I still think that for greppability/searchability it's way
>> better to keep the object name using camel case. In the end as you've
>> pointed out it's just for the specific methods named above. Making it
>> look ugly is IMO less worse than missing something when trying to
>> understand how the code works.
>
>IIRC, Ján raised the issue of avoiding mixed camelcase/snakecase
>namings originally, so CC'ing to see if he's ok with changing
>back again ?

I don't care about it enough to send another e-mail after this one :)

However the case convetion is a part of the macro documentation:
https://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#G-DEFINE-TYPE:CAPS

Jano

>
>Regards,
>Daniel
>-- 
>|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
>|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
>|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>
-------------- 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/20200310/bb468b1e/attachment-0001.sig>


More information about the libvir-list mailing list