[libvirt] [libvirt-glib] Correct namespace prefix for GVirConfig symbols

Daniel P. Berrange berrange at redhat.com
Wed Jan 4 11:21:22 UTC 2012


On Wed, Jan 04, 2012 at 11:48:31AM +0400, Christophe Fergeau wrote:
> On Tue, Jan 03, 2012 at 08:47:02PM +0200, Zeeshan Ali (Khattak) wrote:
> > 
> >   So FWIW I found the patch in Boxes that causes a problem with current API:
> > 
> > https://bugzilla.gnome.org/attachment.cgi?id=204140&action=edit
> > 
> >   Compiling that patch should lead you to this:
> > 
> > vm-configurator.c: In function ‘boxes_vm_configurator_set_video_config’:
> > vm-configurator.c:713:62: error: ‘GVIR_TYPE_DOMAIN_VIDEO_MODEL’
> > undeclared (first use in this function)
> > vm-configurator.c:713:62: note: each undeclared identifier is reported
> > only once for each function it appears in
> > vm-configurator.c: In function ‘boxes_vm_configurator_set_sound_config’:
> > vm-configurator.c:758:62: error: ‘GVIR_TYPE_DOMAIN_SOUND_MODEL’
> > undeclared (first use in this function)
> > vm-configurator.c: In function ‘boxes_vm_configurator_set_tablet_config’:
> > vm-configurator.c:804:62: error: ‘GVIR_TYPE_DOMAIN_INPUT_BUS’
> > undeclared (first use in this function)
> 
> Ah great, thanks! At first I thought your patch was just about making
> things cleaner, so I was a bit surprised that you mentioned issues with
> vala just now. And having a clear problem to think about really helps to
> focus rather than " I promise you, I've seen some problem once, but I
> forgot all the details"
> 
> The issue comes from typeof(GVirConfig.DomainVideoModel). Vala wants to
> change this to GVIR_TYPE_CONFIG_DOMAIN_VIDEO_MODEL but it doesn't really
> have a way of getting this right (I couldn't find an obvious way of getting
> this name from the .gir) so it ends up with GVIR_TYPE_DOMAIN_VIDEO_MODEL
> which doesn't exist. However, the .gir has:
>     <enumeration name="DomainVideoModel"
>                  glib:type-name="GVirConfigDomainVideoModel"
>                  glib:get-type="gvir_config_domain_video_model_get_type"
>                  c:type="GVirConfigDomainVideoModel">
> My feeling is that there would be less magic involved on the Vala side if
> it were to use the value of the glib:get-type attribute instead of trying
> to build a GVIR_TYPE_DOMAIN_VIDEO_MODEL symbol, but it may have very good
> reasons for doing things the way it does.
> 
> Then I'm not saying because of what is above, your patch is not needed,
> it's just me trying to understand what kind of breakage we have because of
> the unusual namespacing.

So I think we're agreed now that Zeeshan's patch should be merged ?

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list