[libvirt] [libvirt-designer][PATCH 4/4] domain: Introduce interface support

Christophe Fergeau cfergeau at redhat.com
Mon Sep 10 09:19:34 UTC 2012


Hey,

On Fri, Sep 07, 2012 at 03:56:34PM +0200, Martin Kletzander wrote:
> On 09/05/2012 11:27 AM, Michal Privoznik wrote:
> > +
> > +static const gchar *
> > +gvir_designer_domain_get_preferred_nic_model(GVirDesignerDomain *design,
> > +                                             GError **error)
> > +{
> > +    const gchar *ret = NULL;
> > +    OsinfoDeviceLink *link = NULL;
> 
> You are using "link" here which shadows some global declaration. I'm
> saying "some" because the compiler told me so, but after many files I
> wasn't so eager to find it, so I don't know which one. Anyway changing
> it to dev_link (as you use everywhere else) worked.

Probably link(3) which creates hardlinks.

> > +
> > +    GVirConfigDomainInterface *ret;
> > +    const gchar *model = NULL;
> > +
> > +    model = gvir_designer_domain_get_preferred_nic_model(design, error);
> > +
> > +    ret = GVIR_CONFIG_DOMAIN_INTERFACE(gvir_config_domain_interface_network_new());
> 
> I can't find the function anywhere, even though it isn't defined
> automagically (IIUC), but it compiles (I wonder what the macro does in
> here).

$prefix/include/libvirt-gconfig-1.0/libvirt-gconfig/libvirt-gconfig-interface.h has:
#define GVIR_CONFIG_INTERFACE(obj)            (G_TYPE_CHECK_INSTANCE_CAST
((obj), GVIR_CONFIG_TYPE_INTERFACE, GVirConfigInterface))
which is C cast + runtime type check. This is used everywhere in GObject
land. gvir_config_domain_interface_network_new is defined in
libvirt-gconfig-domain-interface-network.h

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120910/cbac12be/attachment-0001.sig>


More information about the libvir-list mailing list