[libvirt] [libvirt-glib 26/37] Add gvir_config_interface_set_source

Christophe Fergeau cfergeau at redhat.com
Tue Nov 15 17:55:27 UTC 2011


On Fri, Nov 11, 2011 at 08:08:37PM +0100, Marc-André Lureau wrote:
> On Thu, Nov 10, 2011 at 9:33 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> > The way it's done is just a band-aid though. The need for this
> > 'type' member in GVirConfigInterface and GVirConfigDeviceDisk is
> > a clear indication that they should be separate class.
> 
> You mean there should be a seperate class for source type?

The interface xml node is 
<interface type="xxx"> .... </interface>

What I meant in the commit message is that instead of trying to handle all
possible interface types in a single GVirConfigInterface, we should have
one class per interface type (ie <interface type="xxx"> would be
represented by one class, and <interface type="yyy"> would be a different
class). Since the value of the attribute is not free-form, this is
workable.
And this is what the "Add GVirConfigInterfaceNetwork" patch does. I haven't
done it (yet?) for the GVirConfigDeviceDisk class since for now it was no
big deal not to have the specialized classes.

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/20111115/99bd8315/attachment-0001.sig>


More information about the libvir-list mailing list