[libvirt] [PATCH] qemu: fix miss goto cleanup in qemuDomainAttachNetDevice

Michal Privoznik mprivozn at redhat.com
Tue Jan 6 10:18:01 UTC 2015


On 06.01.2015 10:20, Luyao Huang wrote:
> This place have a wrong logic, maybe forget goto cleanup.
> Also fix some small things.
>
> Signed-off-by: Luyao Huang <lhuang at redhat.com>
> ---
> I am not sure i am right, but hotplug a net do not a address
> may cause a issue.
>
>   src/qemu/qemu_hotplug.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index 5d0d8e0..bfe1bd0 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -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;
>


ACKed and pushed.

Michal




More information about the libvir-list mailing list