]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
network: fix call virNetworkEventLifecycleNew when networkStartNetwork fail
authorLuyao Huang <lhuang@redhat.com>
Sat, 1 Nov 2014 10:03:23 +0000 (18:03 +0800)
committerCole Robinson <crobinso@redhat.com>
Sat, 15 Nov 2014 21:02:08 +0000 (16:02 -0500)
When start a network fail, libvirt still call virNetworkEventLifecycleNew
to send a event.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
(cherry picked from commit 45d9ea5cddad5ed151db15362a881b730b8c88f1)

src/network/bridge_driver.c

index 979fb13247f9b02eb0fccd409d39c99ca110ee3d..b69c40e99afeb1563746ab24eac9d4cd06431e3d 100644 (file)
@@ -3253,7 +3253,8 @@ static int networkCreate(virNetworkPtr net)
     if (virNetworkCreateEnsureACL(net->conn, network->def) < 0)
         goto cleanup;
 
-    ret = networkStartNetwork(driver, network);
+    if ((ret = networkStartNetwork(driver, network)) < 0)
+        goto cleanup;
 
     event = virNetworkEventLifecycleNew(network->def->name,
                                         network->def->uuid,