diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 19d4dcbe819b23b2a175ad9dd83f8952066f792c..462bc9cc2a2a97f23331cd5bfe0074c37ad822d5 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1284,7 +1284,7 @@ static int lxcVmStart(virConnectPtr conn, if (lxcSetupInterfaces(conn, vm->def, &nveths, &veths) != 0) goto cleanup; - /* Persist the live configuration now we have veth & tty info */ + /* Save the configuration for the controller */ if (virDomainSaveConfig(driver->stateDir, vm->def) < 0) goto cleanup; @@ -1328,6 +1328,13 @@ static int lxcVmStart(virConnectPtr conn, goto cleanup; } + /* + * Again, need to save the live configuration, because the function + * requires vm->def->id != -1 to save tty info surely. + */ + if (virDomainSaveConfig(driver->stateDir, vm->def) < 0) + goto cleanup; + rc = 0; cleanup: