network: Add virNetworkObj Get/Set API's for @def and @newDef

In preparation for making the object private, create a couple of API's
to get the obj->def & obj->newDef and set the obj->def.

While altering networkxml2conftest.c to use the virNetworkObjSetDef
API, fix the name of the variable from @dev to @def

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan
2017-05-09 18:38:58 -04:00
parent 062c38ce75
commit db207a6233
6 changed files with 355 additions and 258 deletions

View File

@@ -23,20 +23,21 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, dnsmasqCapsPtr
{
char *actual = NULL;
int ret = -1;
virNetworkDefPtr dev = NULL;
virNetworkDefPtr def = NULL;
virNetworkObjPtr obj = NULL;
virCommandPtr cmd = NULL;
char *pidfile = NULL;
dnsmasqContext *dctx = NULL;
if (!(dev = virNetworkDefParseFile(inxml)))
if (!(def = virNetworkDefParseFile(inxml)))
goto fail;
if (!(obj = virNetworkObjNew()))
goto fail;
obj->def = dev;
dctx = dnsmasqContextNew(dev->name, "/var/lib/libvirt/dnsmasq");
virNetworkObjSetDef(obj, def);
dctx = dnsmasqContextNew(def->name, "/var/lib/libvirt/dnsmasq");
if (dctx == NULL)
goto fail;