mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
vz: implement connectGetMaxVcpus API calls
Because we have no limitation for maximal number of vcpus in containers we report as maximum 1028 just for the sake of common sence. Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
This commit is contained in:
parent
6222a6fee3
commit
e16dd5f2d2
@ -1337,12 +1337,26 @@ vzDomainMemoryStats(virDomainPtr domain,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int vzConnectGetMaxVcpus(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||||
|
const char *type)
|
||||||
|
{
|
||||||
|
/* As far as we have no limitation for containers
|
||||||
|
* we report maximum */
|
||||||
|
if (type == NULL || STRCASEEQ(type, "vz") || STRCASEEQ(type, "parallels"))
|
||||||
|
return 1028;
|
||||||
|
|
||||||
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
|
_("unknown type '%s'"), type);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
static virHypervisorDriver vzDriver = {
|
static virHypervisorDriver vzDriver = {
|
||||||
.name = "vz",
|
.name = "vz",
|
||||||
.connectOpen = vzConnectOpen, /* 0.10.0 */
|
.connectOpen = vzConnectOpen, /* 0.10.0 */
|
||||||
.connectClose = vzConnectClose, /* 0.10.0 */
|
.connectClose = vzConnectClose, /* 0.10.0 */
|
||||||
.connectGetVersion = vzConnectGetVersion, /* 0.10.0 */
|
.connectGetVersion = vzConnectGetVersion, /* 0.10.0 */
|
||||||
.connectGetHostname = vzConnectGetHostname, /* 0.10.0 */
|
.connectGetHostname = vzConnectGetHostname, /* 0.10.0 */
|
||||||
|
.connectGetMaxVcpus = vzConnectGetMaxVcpus, /* 1.2.21 */
|
||||||
.nodeGetInfo = vzNodeGetInfo, /* 0.10.0 */
|
.nodeGetInfo = vzNodeGetInfo, /* 0.10.0 */
|
||||||
.connectGetCapabilities = vzConnectGetCapabilities, /* 0.10.0 */
|
.connectGetCapabilities = vzConnectGetCapabilities, /* 0.10.0 */
|
||||||
.connectBaselineCPU = vzConnectBaselineCPU, /* 1.2.6 */
|
.connectBaselineCPU = vzConnectBaselineCPU, /* 1.2.6 */
|
||||||
|
Loading…
Reference in New Issue
Block a user