mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 05:57:16 +00:00
libxl: remove obsolete check for result of xc_get_max_cpus
xc_get_max_cpus from Xen version 4.3 may return 0 in case xc_physinfo fails. This has been fixed in Xen 4.4. Remove the obsolete result check from libvirt. Just convert libxl error codes to plain -1. Signed-off-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
70492e33e3
commit
6de6767b56
@ -972,11 +972,7 @@ libxlConnectGetMaxVcpus(virConnectPtr conn, const char *type G_GNUC_UNUSED)
|
|||||||
|
|
||||||
cfg = libxlDriverConfigGet(driver);
|
cfg = libxlDriverConfigGet(driver);
|
||||||
ret = libxl_get_max_cpus(cfg->ctx);
|
ret = libxl_get_max_cpus(cfg->ctx);
|
||||||
/* On failure, libxl_get_max_cpus() will return ERROR_FAIL from Xen 4.4
|
if (ret < 0)
|
||||||
* onward, but it ever returning 0 is obviously wrong too (and it is
|
|
||||||
* what happens, on failure, on Xen 4.3 and earlier). Therefore, a 'less
|
|
||||||
* or equal' is the catchall we want. */
|
|
||||||
if (ret <= 0)
|
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
virObjectUnref(cfg);
|
virObjectUnref(cfg);
|
||||||
|
Loading…
Reference in New Issue
Block a user