mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
ch_driver: Refactor virCHProcessStart
Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
829340127d
commit
ed12c63f89
@ -461,6 +461,34 @@ virCHProcessSetupVcpus(virDomainObj *vm)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
virCHProcessSetup(virDomainObj *vm)
|
||||||
|
{
|
||||||
|
virCHDomainObjPrivate *priv = vm->privateData;
|
||||||
|
|
||||||
|
virCHDomainRefreshThreadInfo(vm);
|
||||||
|
|
||||||
|
VIR_DEBUG("Setting emulator tuning/settings");
|
||||||
|
if (virCHProcessSetupEmulatorThreads(vm) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
VIR_DEBUG("Setting iothread tuning/settings");
|
||||||
|
if (virCHProcessSetupIOThreads(vm) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
VIR_DEBUG("Setting global CPU cgroup (if required)");
|
||||||
|
if (virDomainCgroupSetupGlobalCpuCgroup(vm,
|
||||||
|
priv->cgroup) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
VIR_DEBUG("Setting vCPU tuning/settings");
|
||||||
|
if (virCHProcessSetupVcpus(vm) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
virCHProcessUpdateInfo(vm);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define PKT_TIMEOUT_MS 500 /* ms */
|
#define PKT_TIMEOUT_MS 500 /* ms */
|
||||||
|
|
||||||
@ -764,26 +792,9 @@ virCHProcessStart(virCHDriver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
virCHDomainRefreshThreadInfo(vm);
|
if (virCHProcessSetup(vm) < 0)
|
||||||
|
|
||||||
VIR_DEBUG("Setting emulator tuning/settings");
|
|
||||||
if (virCHProcessSetupEmulatorThreads(vm) < 0)
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG("Setting iothread tuning/settings");
|
|
||||||
if (virCHProcessSetupIOThreads(vm) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
VIR_DEBUG("Setting global CPU cgroup (if required)");
|
|
||||||
if (virDomainCgroupSetupGlobalCpuCgroup(vm,
|
|
||||||
priv->cgroup) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
VIR_DEBUG("Setting vCPU tuning/settings");
|
|
||||||
if (virCHProcessSetupVcpus(vm) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
virCHProcessUpdateInfo(vm);
|
|
||||||
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, reason);
|
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, reason);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user