All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
	andrew.cooper3@citrix.com, Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Charles Arnold <carnold@suse.com>
Subject: [PATCH v2 1/4] libxenstat: reuse xc_handle open in xenstat_init
Date: Wed, 8 Apr 2015 17:08:19 +0100	[thread overview]
Message-ID: <1428509302-10081-2-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1428509302-10081-1-git-send-email-wei.liu2@citrix.com>

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Charles Arnold <carnold@suse.com>
---
 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

  reply	other threads:[~2015-04-08 16:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 16:08 [PATCH v2 0/4] libxenstat bug fixes and cleanups Wei Liu
2015-04-08 16:08 ` Wei Liu [this message]
2015-04-08 16:11   ` [PATCH v2 1/4] libxenstat: reuse xc_handle open in xenstat_init Andrew Cooper
2015-04-08 16:08 ` [PATCH v2 2/4] libxenstat: YAJL_GET_STRING may return NULL Wei Liu
2015-04-08 16:08 ` [PATCH v2 3/4] libxenstat: always free qmp_stats Wei Liu
2015-04-08 16:08 ` [PATCH v2 4/4] libxenstat: qmp_read fix and cleanup Wei Liu
2015-04-08 16:11   ` Andrew Cooper
2015-04-15 16:27 ` [PATCH v2 0/4] libxenstat bug fixes and cleanups Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428509302-10081-2-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=carnold@suse.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.