]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Do not release unreserved address in qemuDomainAttachRNGDevice
authorJán Tomko <jtomko@redhat.com>
Fri, 19 May 2017 12:14:32 +0000 (14:14 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 22 May 2017 08:29:01 +0000 (10:29 +0200)
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 <jferlan@redhat.com>
src/qemu/qemu_hotplug.c

index 1d7f2cc71b0e695b1a98adcf6e9b84f87d9c1d8b..e99895af680250f0d56748c9e2706d844897e35c 100644 (file)
@@ -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;