diff options
author | Maxim Nestratov <mnestratov@virtuozzo.com> | 2015-10-19 22:02:00 +0300 |
---|---|---|
committer | Dmitry Guryanov <dguryanov@parallels.com> | 2015-10-20 09:58:17 +0300 |
commit | e16dd5f2d29b1f6e30ffe9a6cfd83f702af2f0d6 (patch) | |
tree | 9f076a99c81b50d56bfda65ca4278d0357a1a525 | |
parent | 6222a6fee3f01f4fab8b45cacc9776170bf6dcd4 (diff) | |
download | libvirt-e16dd5f2d29b1f6e30ffe9a6cfd83f702af2f0d6.tar.gz |
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>
-rw-r--r-- | src/vz/vz_driver.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 15dc70f240..987824f388 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -1337,12 +1337,26 @@ vzDomainMemoryStats(virDomainPtr domain, 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 = { .name = "vz", .connectOpen = vzConnectOpen, /* 0.10.0 */ .connectClose = vzConnectClose, /* 0.10.0 */ .connectGetVersion = vzConnectGetVersion, /* 0.10.0 */ .connectGetHostname = vzConnectGetHostname, /* 0.10.0 */ + .connectGetMaxVcpus = vzConnectGetMaxVcpus, /* 1.2.21 */ .nodeGetInfo = vzNodeGetInfo, /* 0.10.0 */ .connectGetCapabilities = vzConnectGetCapabilities, /* 0.10.0 */ .connectBaselineCPU = vzConnectBaselineCPU, /* 1.2.6 */ |