mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user