From 9b111048ad9590b9be95cfb1720af0eed375d266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 27 May 2016 12:56:05 +0200 Subject: [PATCH] Clean up redundant usage of virDomainObjSetDefTransient Commit 45ec297d from November 2010: Make state driver device hotplug/update actually transient added virDomainObjSetDefTransient calls to the domain startup function in several drivers. In November 2011, commit 8866eed: Set aliases for LXC/UML console devices added a call earlier in the startup function, without removing the existing ones. Also, in the UML driver it seems the function never did anything useful - vm->def->id is set asynchronnously in umlNotifyEvent. At the time of calling virDomainObjSetDefTransient with live=false, vm->def->id was likely still -1, making the call a no-op. --- src/lxc/lxc_process.c | 4 ---- src/uml/uml_driver.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 17fbc5f6e6..058c3e1e7e 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -1542,10 +1542,6 @@ int virLXCProcessStart(virConnectPtr conn, conn, lxcProcessAutoDestroy) < 0) goto cleanup; - if (virDomainObjSetDefTransient(caps, driver->xmlopt, - vm, false) < 0) - goto cleanup; - /* We don't need the temporary NIC names anymore, clear them */ virLXCProcessCleanInterfaces(vm->def); diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 923c3f6e97..d68054e0aa 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -1130,7 +1130,7 @@ static int umlStartVMDaemon(virConnectPtr conn, umlProcessAutoDestroyAdd(driver, vm, conn) < 0) goto cleanup; - ret = virDomainObjSetDefTransient(driver->caps, driver->xmlopt, vm, false); + ret = 0; cleanup: VIR_FORCE_CLOSE(logfd); virCommandFree(cmd);