Commit id '6e6b4bfc' added the object, but forgot the other end.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index e287aaf..f401b48 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3608,6 +3608,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
virObjectEventPtr event;
char *charAlias = NULL;
char *objAlias = NULL;
+ char *tlsAlias = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
ssize_t idx;
int ret = -1;
@@ -3616,15 +3617,23 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
VIR_DEBUG("Removing RNG device %s from domain %p %s",
rng->info.alias, vm, vm->def->name);
+
if (virAsprintf(&objAlias, "obj%s", rng->info.alias) < 0)
goto cleanup;
if (!(charAlias = qemuAliasChardevFromDevAlias(rng->info.alias)))
goto cleanup;
+ if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD &&
+ !(tlsAlias = qemuAliasTLSObjFromChardevAlias(charAlias)))
+ goto cleanup;
+
qemuDomainObjEnterMonitor(driver, vm);
- if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD)
+ if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD) {
+ if (tlsAlias)
+ ignore_value(qemuMonitorDelObject(priv->mon, tlsAlias));
ignore_value(qemuMonitorDetachCharDev(priv->mon, charAlias));
+ }
rc = qemuMonitorDelObject(priv->mon, objAlias);
@@ -3648,6 +3657,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
cleanup:
VIR_FREE(charAlias);
VIR_FREE(objAlias);
+ VIR_FREE(tlsAlias);
return ret;
}
--
2.7.4