[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 1/4] libxenstat: reuse xc_handle open in xenstat_init



Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Charles Arnold <carnold@xxxxxxxx>
---
 tools/xenstat/libxenstat/src/xenstat_qmp.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c 
b/tools/xenstat/libxenstat/src/xenstat_qmp.c
index 2cb99e9..10ae104 100644
--- a/tools/xenstat/libxenstat/src/xenstat_qmp.c
+++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c
@@ -357,17 +357,14 @@ static int qmp_connect(char *path)
 }
 
 /* Get up to 1024 active domains */
-static xc_domaininfo_t *get_domain_ids(int *num_doms)
+static xc_domaininfo_t *get_domain_ids(xc_interface *xc_handle, int *num_doms)
 {
        xc_domaininfo_t *dominfo;
-       xc_interface *xc_handle;
 
        dominfo = calloc(1024, sizeof(xc_domaininfo_t));
        if (dominfo == NULL)
                return NULL;
-       xc_handle = xc_interface_open(0,0,0);
        *num_doms = xc_domain_getinfolist(xc_handle, 0, 1024, dominfo);
-       xc_interface_close(xc_handle);
        return dominfo;
 }
 
@@ -406,7 +403,7 @@ void read_attributes_qdisk(xenstat_node * node)
        char path[80];
        int i, qfd, num_doms;
 
-       dominfo = get_domain_ids(&num_doms);
+       dominfo = get_domain_ids(node->handle->xc_handle, &num_doms);
        if (dominfo == NULL)
                return;
 
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.