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(a)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