mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03:00
lxc: refactor virLXCProcessBuildControllerCmd
Use automatic cleanup and remove the labels. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
fe9d5d6d00
commit
1e6b81cdec
@ -935,7 +935,7 @@ virLXCProcessBuildControllerCmd(virLXCDriver *driver,
|
|||||||
size_t i;
|
size_t i;
|
||||||
g_autofree char *filterstr = NULL;
|
g_autofree char *filterstr = NULL;
|
||||||
g_autofree char *outputstr = NULL;
|
g_autofree char *outputstr = NULL;
|
||||||
virCommand *cmd;
|
g_autoptr(virCommand) cmd = NULL;
|
||||||
g_autoptr(virLXCDriverConfig) cfg = virLXCDriverGetConfig(driver);
|
g_autoptr(virLXCDriverConfig) cfg = virLXCDriverGetConfig(driver);
|
||||||
|
|
||||||
cmd = virCommandNew(vm->def->emulator);
|
cmd = virCommandNew(vm->def->emulator);
|
||||||
@ -955,7 +955,7 @@ virLXCProcessBuildControllerCmd(virLXCDriver *driver,
|
|||||||
if (cfg->log_libvirtd) {
|
if (cfg->log_libvirtd) {
|
||||||
if (virLogGetNbOutputs() > 0) {
|
if (virLogGetNbOutputs() > 0) {
|
||||||
if (!(outputstr = virLogGetOutputs()))
|
if (!(outputstr = virLogGetOutputs()))
|
||||||
goto error;
|
return NULL;
|
||||||
|
|
||||||
virCommandAddEnvPair(cmd, "LIBVIRT_LOG_OUTPUTS", outputstr);
|
virCommandAddEnvPair(cmd, "LIBVIRT_LOG_OUTPUTS", outputstr);
|
||||||
}
|
}
|
||||||
@ -1007,12 +1007,7 @@ virLXCProcessBuildControllerCmd(virLXCDriver *driver,
|
|||||||
* write the live domain status XML with the PID */
|
* write the live domain status XML with the PID */
|
||||||
virCommandRequireHandshake(cmd);
|
virCommandRequireHandshake(cmd);
|
||||||
|
|
||||||
cleanup:
|
return g_steal_pointer(&cmd);
|
||||||
return cmd;
|
|
||||||
error:
|
|
||||||
virCommandFree(cmd);
|
|
||||||
cmd = NULL;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user