]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: User per-domain ctx in libxlDomainGetInfo
authorJim Fehlig <jfehlig@suse.com>
Fri, 30 Aug 2013 20:36:22 +0000 (14:36 -0600)
committerJim Fehlig <jfehlig@suse.com>
Tue, 3 Sep 2013 22:43:20 +0000 (16:43 -0600)
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.

src/libxl/libxl_driver.c

index b8c34f7618f535fa5c3b6740c93c3a8fff67b793..7cdba8fe2307a1d6947624ac98a4c69803e42559 100644 (file)
@@ -1835,6 +1835,7 @@ libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
     libxlDriverPrivatePtr driver = dom->conn->privateData;
     virDomainObjPtr vm;
     libxl_dominfo d_info;
+    libxlDomainObjPrivatePtr priv;
     int ret = -1;
 
     libxlDriverLock(driver);
@@ -1850,12 +1851,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;