[libvirt] test driver for interface config
Laine Stump
laine at laine.org
Tue Apr 7 15:59:52 UTC 2009
On 04/07/2009 11:35 AM, Daniel P. Berrange wrote:
> On Tue, Apr 07, 2009 at 10:39:22AM -0400, Laine Stump wrote:
>
>> I'm now trying to write the test driver for the interface config driver
>> that I'm putting into libvirt. For comparison I'm using the network
>> driver. My understanding so far is that it calls the functions in the
>> real driver to construct network objects and manipulate them, then just
>> doesn't call the code that makes the changes to the system config.
>>
>
> No, this isn't quite right. The test driver is a driver in its own
> right - it doesn't call into any of the 'real' network driver.
>
> Both the 'test' and 'real' network drivers share the same XML
> parsing & formatting routines and internal object structures
> from network_conf.h/.c
>
Right, that's what I meant, but it didn't come out that way - the
corresponding functions in each driver are almost identical to each
other, just with some crucial omissions in the test driver case.
It's sounding like the test driver will be a larger, more complex beast
than the live driver that has netcf behind it.
> Even though its doing a passthrough to netcf library, the netcf driver
> would still need to parse the XML in accordance with libvirt
> defined schema. It just happens that netcf uses the same XML
> format, so it can then convert it back into XML and pass it on
> through to netcf.
>
I've heard differing opinions on that. As long as the format is
identical, it's not really needed (as long as you can rely on proper
error handling/reporting from netcf), but if it has to be done anyway
for the test driver, then it's not much extra effort to do it for netcf too.
More information about the libvir-list
mailing list