[libvirt] [PATCH] test: Activate interfaces specified through driver config file.

This matches the behavior of domains, storage, etc. Also, fix up some whitespace issues in the area. Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/test/test_driver.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0b866d2..0541a73 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -779,13 +779,16 @@ static int testOpenFromFile(virConnectPtr conn, if (!def) goto error; } else { - if ((def = virInterfaceDefParseNode(conn, xml, ifaces[i])) == NULL) + if ((def = virInterfaceDefParseNode(conn, xml, ifaces[i])) == NULL) goto error; } + if (!(iface = virInterfaceAssignDef(conn, &privconn->ifaces, def))) { virInterfaceDefFree(def); goto error; } + + iface->active = 1; virInterfaceObjUnlock(iface); } VIR_FREE(ifaces); -- 1.6.5.rc2

On Mon, Oct 12, 2009 at 10:32:13AM -0400, Cole Robinson wrote:
This matches the behavior of domains, storage, etc. Also, fix up some whitespace issues in the area.
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/test/test_driver.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0b866d2..0541a73 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -779,13 +779,16 @@ static int testOpenFromFile(virConnectPtr conn, if (!def) goto error; } else { - if ((def = virInterfaceDefParseNode(conn, xml, ifaces[i])) == NULL) + if ((def = virInterfaceDefParseNode(conn, xml, ifaces[i])) == NULL) goto error; } + if (!(iface = virInterfaceAssignDef(conn, &privconn->ifaces, def))) { virInterfaceDefFree(def); goto error; } + + iface->active = 1; virInterfaceObjUnlock(iface); } VIR_FREE(ifaces); ACK
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Oct 12, 2009 at 10:32:13AM -0400, Cole Robinson wrote:
This matches the behavior of domains, storage, etc. Also, fix up some whitespace issues in the area.
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/test/test_driver.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0b866d2..0541a73 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -779,13 +779,16 @@ static int testOpenFromFile(virConnectPtr conn, if (!def) goto error; } else { - if ((def = virInterfaceDefParseNode(conn, xml, ifaces[i])) == NULL) + if ((def = virInterfaceDefParseNode(conn, xml, ifaces[i])) == NULL) goto error; } + if (!(iface = virInterfaceAssignDef(conn, &privconn->ifaces, def))) { virInterfaceDefFree(def); goto error; } + + iface->active = 1; virInterfaceObjUnlock(iface); } VIR_FREE(ifaces);
ACK, please push that one too :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 10/13/2009 10:48 AM, Daniel Veillard wrote:
On Mon, Oct 12, 2009 at 10:32:13AM -0400, Cole Robinson wrote:
This matches the behavior of domains, storage, etc. Also, fix up some whitespace issues in the area.
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/test/test_driver.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0b866d2..0541a73 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -779,13 +779,16 @@ static int testOpenFromFile(virConnectPtr conn, if (!def) goto error; } else { - if ((def = virInterfaceDefParseNode(conn, xml, ifaces[i])) == NULL) + if ((def = virInterfaceDefParseNode(conn, xml, ifaces[i])) == NULL) goto error; } + if (!(iface = virInterfaceAssignDef(conn, &privconn->ifaces, def))) { virInterfaceDefFree(def); goto error; } + + iface->active = 1; virInterfaceObjUnlock(iface); } VIR_FREE(ifaces);
ACK, please push that one too :-)
Daniel
Pushed now. Thanks, Cole
participants (3)
-
Cole Robinson
-
Daniel P. Berrange
-
Daniel Veillard