提交 a9cb3548 编写于 作者: R Ryota Ozaki 提交者: Daniel Veillard

LXC cleanup deep indentation in lxcDomainSetAutostart

* src/lxc/lxc_driver.c: refactor lxcDomainSetAutostart() to avoid deep
  indentation of the code
上级 24e3b35c
...@@ -1992,10 +1992,18 @@ static int lxcDomainSetAutostart(virDomainPtr dom, ...@@ -1992,10 +1992,18 @@ static int lxcDomainSetAutostart(virDomainPtr dom,
autostart = (autostart != 0); autostart = (autostart != 0);
if (vm->autostart != autostart) { if (vm->autostart == autostart) {
if ((configFile = virDomainConfigFile(dom->conn, driver->configDir, vm->def->name)) == NULL) ret = 0;
goto cleanup; 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; goto cleanup;
if (autostart) { if (autostart) {
...@@ -2024,7 +2032,6 @@ static int lxcDomainSetAutostart(virDomainPtr dom, ...@@ -2024,7 +2032,6 @@ static int lxcDomainSetAutostart(virDomainPtr dom,
} }
vm->autostart = autostart; vm->autostart = autostart;
}
ret = 0; ret = 0;
cleanup: cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册