libxlDomainGetInfo() uses the driver-wide libxl ctx when
it would be more appropriate to use the per-domain ctx
associated with the domain. Switch to using the per-domain
libxl ctx.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_driver.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 6fd9178..a26fbf6 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1818,6 +1818,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
libxlDriverPrivatePtr driver = dom->conn->privateData;
virDomainObjPtr vm;
libxl_dominfo d_info;
+ libxlDomainObjPrivatePtr priv;
int ret = -1;
libxlDriverLock(driver);
@@ -1833,12 +1834,13 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
if (virDomainGetInfoEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
+ priv = vm->privateData;
if (!virDomainObjIsActive(vm)) {
info->cpuTime = 0;
info->memory = vm->def->mem.cur_balloon;
info->maxMem = vm->def->mem.max_balloon;
} else {
- if (libxl_domain_info(driver->ctx, &d_info, dom->id) != 0) {
+ if (libxl_domain_info(priv->ctx, &d_info, dom->id) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("libxl_domain_info failed for domain
'%d'"), dom->id);
goto cleanup;
--
1.8.1.4