mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +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,15 +118,14 @@ openvzDomObjFromDomain(struct openvz_driver *driver,
|
|||||||
static virCommand *
|
static virCommand *
|
||||||
openvzDomainDefineCmd(virDomainDef *vmdef)
|
openvzDomainDefineCmd(virDomainDef *vmdef)
|
||||||
{
|
{
|
||||||
virCommand *cmd = virCommandNewArgList(VZCTL,
|
g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL,
|
||||||
"--quiet",
|
"--quiet",
|
||||||
"create",
|
"create",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (vmdef == NULL) {
|
if (vmdef == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Container is not defined"));
|
_("Container is not defined"));
|
||||||
virCommandFree(cmd);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +136,7 @@ openvzDomainDefineCmd(virDomainDef *vmdef)
|
|||||||
virCommandAddArgList(cmd, "--ostemplate", vmdef->fss[0]->src, NULL);
|
virCommandAddArgList(cmd, "--ostemplate", vmdef->fss[0]->src, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd;
|
return g_steal_pointer(&cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user