mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
LXC cleanup deep indentation in lxcDomainSetAutostart
* src/lxc/lxc_driver.c: refactor lxcDomainSetAutostart() to avoid deep indentation of the code
This commit is contained in:
parent
24e3b35c6c
commit
a9cb354833
@ -1992,10 +1992,18 @@ static int lxcDomainSetAutostart(virDomainPtr dom,
|
||||
|
||||
autostart = (autostart != 0);
|
||||
|
||||
if (vm->autostart != autostart) {
|
||||
if ((configFile = virDomainConfigFile(dom->conn, driver->configDir, vm->def->name)) == NULL)
|
||||
if (vm->autostart == autostart) {
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
if ((autostartLink = virDomainConfigFile(dom->conn, driver->autostartDir, vm->def->name)) == NULL)
|
||||
}
|
||||
|
||||
configFile = virDomainConfigFile(dom->conn, driver->configDir,
|
||||
vm->def->name);
|
||||
if (configFile == NULL)
|
||||
goto cleanup;
|
||||
autostartLink = virDomainConfigFile(dom->conn, driver->autostartDir,
|
||||
vm->def->name);
|
||||
if (autostartLink == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (autostart) {
|
||||
@ -2024,7 +2032,6 @@ static int lxcDomainSetAutostart(virDomainPtr dom,
|
||||
}
|
||||
|
||||
vm->autostart = autostart;
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
|
Loading…
Reference in New Issue
Block a user