mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
openvz: refactor openvzDomainDefineCmd
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
0dfb73a511
commit
560de4e5cd
@ -118,7 +118,7 @@ openvzDomObjFromDomain(struct openvz_driver *driver,
|
||||
static virCommand *
|
||||
openvzDomainDefineCmd(virDomainDef *vmdef)
|
||||
{
|
||||
virCommand *cmd = virCommandNewArgList(VZCTL,
|
||||
g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL,
|
||||
"--quiet",
|
||||
"create",
|
||||
NULL);
|
||||
@ -126,7 +126,6 @@ openvzDomainDefineCmd(virDomainDef *vmdef)
|
||||
if (vmdef == NULL) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Container is not defined"));
|
||||
virCommandFree(cmd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -137,7 +136,7 @@ openvzDomainDefineCmd(virDomainDef *vmdef)
|
||||
virCommandAddArgList(cmd, "--ostemplate", vmdef->fss[0]->src, NULL);
|
||||
}
|
||||
|
||||
return cmd;
|
||||
return g_steal_pointer(&cmd);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user