diff --git a/ChangeLog b/ChangeLog index 48e966e1e7..a44d65caee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jul 6 16:19:00 BST 2007 Richard W.M. Jones + + * src/libvirt.c, src/qemu_driver.c: If the virNetworkLookup* + functions cannot find a network, then they now throw + VIR_ERR_NO_NETWORK error. + Fri Jul 6 16:08:00 BST 2007 Richard W.M. Jones * src/proxy_internal.c, src/proxy_internal.h, diff --git a/src/libvirt.c b/src/libvirt.c index 163ed82026..f0807785d0 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -2338,7 +2338,8 @@ virConnectListDefinedNetworks(virConnectPtr conn, char **const names, * * Try to lookup a network on the given hypervisor based on its name. * - * Returns a new network object or NULL in case of failure + * Returns a new network object or NULL in case of failure. If the + * network cannot be found, then VIR_ERR_NO_NETWORK error is raised. */ virNetworkPtr virNetworkLookupByName(virConnectPtr conn, const char *name) @@ -2366,7 +2367,8 @@ virNetworkLookupByName(virConnectPtr conn, const char *name) * * Try to lookup a network on the given hypervisor based on its UUID. * - * Returns a new network object or NULL in case of failure + * Returns a new network object or NULL in case of failure. If the + * network cannot be found, then VIR_ERR_NO_NETWORK error is raised. */ virNetworkPtr virNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid) @@ -2394,7 +2396,8 @@ virNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid) * * Try to lookup a network on the given hypervisor based on its UUID. * - * Returns a new network object or NULL in case of failure + * Returns a new network object or NULL in case of failure. If the + * network cannot be found, then VIR_ERR_NO_NETWORK error is raised. */ virNetworkPtr virNetworkLookupByUUIDString(virConnectPtr conn, const char *uuidstr) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 91cf920675..0f233eaba1 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -2155,7 +2155,7 @@ static virNetworkPtr qemudNetworkLookupByUUID(virConnectPtr conn ATTRIBUTE_UNUSE virNetworkPtr net; if (!network) { - qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "no network with matching uuid"); + qemudReportError(conn, NULL, NULL, VIR_ERR_NO_NETWORK, "no network with matching uuid"); return NULL; } @@ -2169,7 +2169,7 @@ static virNetworkPtr qemudNetworkLookupByName(virConnectPtr conn ATTRIBUTE_UNUSE virNetworkPtr net; if (!network) { - qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "no network with matching name"); + qemudReportError(conn, NULL, NULL, VIR_ERR_NO_NETWORK, "no network with matching name"); return NULL; }