From 5de555cae285d7d1456607f667b6e7e661d0dd3b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 22 Jun 2009 16:39:23 +0000 Subject: [PATCH] Activate virtual networks initialized in custom test driver. If specifying a custom test driver, virtual networks were not 'activated' on driver init. This differs from the behavior of domains and storage pools, so fix it. Also improve a couple error messages in that area. --- ChangeLog | 4 ++++ src/test.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8c157a8f0..faf3da6903 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Jun 22 12:38:19 EDT 2009 Cole Robinson + + * src/test.c: Activate virtual networks initialized in custom test driver. + Mon Jun 22 12:35:34 EDT 2009 Cole Robinson * src/util.c: Fix segfault if storage pool has no type attribute diff --git a/src/test.c b/src/test.c index 2a672a3f69..7bc3fee56a 100644 --- a/src/test.c +++ b/src/test.c @@ -381,7 +381,8 @@ static int testOpenFromFile(virConnectPtr conn, if (!(xml = xmlReadFd(fd, file, NULL, XML_PARSE_NOENT | XML_PARSE_NONET | XML_PARSE_NOERROR | XML_PARSE_NOWARNING))) { - testError(NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("host")); + testError(NULL, VIR_ERR_INTERNAL_ERROR, + _("Invalid XML in file '%s'"), file); goto error; } close(fd); @@ -389,7 +390,8 @@ static int testOpenFromFile(virConnectPtr conn, root = xmlDocGetRootElement(xml); if ((root == NULL) || (!xmlStrEqual(root->name, BAD_CAST "node"))) { - testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node")); + testError(NULL, VIR_ERR_XML_ERROR, "%s", + _("Root element is not 'node'")); goto error; } @@ -541,6 +543,7 @@ static int testOpenFromFile(virConnectPtr conn, goto error; } net->persistent = 1; + net->active = 1; virNetworkObjUnlock(net); } VIR_FREE(networks); -- GitLab