From: Ján Tomko Date: Fri, 19 May 2017 12:14:32 +0000 (+0200) Subject: Do not release unreserved address in qemuDomainAttachRNGDevice X-Git-Tag: v3.4.0-rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f25f30aff548636d0c8782d3eaee049c77548dd5;p=thirdparty%2Flibvirt.git Do not release unreserved address in qemuDomainAttachRNGDevice Only set releaseaddr to true after the address has been reserved successfully. https://bugzilla.redhat.com/show_bug.cgi?id=1452581 Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1d7f2cc71b..e99895af68 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2090,7 +2090,6 @@ qemuDomainAttachRNGDevice(virConnectPtr conn, rng->source.file)) goto cleanup; } - releaseaddr = true; if (rng->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE || rng->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { @@ -2103,6 +2102,7 @@ qemuDomainAttachRNGDevice(virConnectPtr conn, !rng->info.addr.ccw.assigned) < 0) goto cleanup; } + releaseaddr = true; if (qemuDomainNamespaceSetupRNG(driver, vm, rng) < 0) goto cleanup;