]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: fix miss goto cleanup in qemuDomainAttachNetDevice
authorLuyao Huang <lhuang@redhat.com>
Tue, 6 Jan 2015 09:20:30 +0000 (17:20 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 6 Jan 2015 10:07:13 +0000 (11:07 +0100)
This place have a wrong logic, maybe forget goto cleanup.
Also fix some small things.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
src/qemu/qemu_hotplug.c

index 5d0d8e051cb9a4bf6cb0a401e0c8e12a13657217..bfe1bd03b1f043979e385c1b9dd0d67e5734e867 100644 (file)
@@ -924,7 +924,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
 
     /* Set device online immediately */
     if (qemuInterfaceStartDevice(net) < 0)
-       goto cleanup;
+        goto cleanup;
 
     /* Set Bandwidth */
     if (virNetDevSupportBandwidth(actualType) &&
@@ -952,7 +952,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
             goto cleanup;
     } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                        _("virtio-s390 net device cannot be hotplugged."));
+                       _("virtio-s390 net device cannot be hotplugged."));
+        goto cleanup;
     } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
                virDomainPCIAddressEnsureAddr(priv->pciaddrs, &net->info) < 0) {
         goto cleanup;