From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>, xen-devel@lists.xen.org
Cc: Charles Arnold <carnold@suse.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH 1/4] libxenstat: check xc_interface_open return value
Date: Wed, 8 Apr 2015 16:21:56 +0100 [thread overview]
Message-ID: <55254794.2020806@citrix.com> (raw)
In-Reply-To: <1428505275-6563-2-git-send-email-wei.liu2@citrix.com>
On 08/04/15 16:01, Wei Liu wrote:
> 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>
The xenstat handle passed around already has an open xc_handle. That
should be reused rather than opening a new one every time we want to get
a list of domain ids.
~Andrew
> ---
> tools/xenstat/libxenstat/src/xenstat_qmp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c b/tools/xenstat/libxenstat/src/xenstat_qmp.c
> index 2cb99e9..f3aeec4 100644
> --- a/tools/xenstat/libxenstat/src/xenstat_qmp.c
> +++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c
> @@ -366,6 +366,8 @@ static xc_domaininfo_t *get_domain_ids(int *num_doms)
> if (dominfo == NULL)
> return NULL;
> xc_handle = xc_interface_open(0,0,0);
> + if (xc_handle == NULL)
> + return NULL;
> *num_doms = xc_domain_getinfolist(xc_handle, 0, 1024, dominfo);
> xc_interface_close(xc_handle);
> return dominfo;
next prev parent reply other threads:[~2015-04-08 15:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 15:01 [PATCH 0/4] libxenstat bug fixes and cleanups Wei Liu
2015-04-08 15:01 ` [PATCH 1/4] libxenstat: check xc_interface_open return value Wei Liu
2015-04-08 15:21 ` Andrew Cooper [this message]
2015-04-08 15:47 ` Wei Liu
2015-04-08 15:01 ` [PATCH 2/4] libxenstat: YAJL_GET_STRING may return NULL Wei Liu
2015-04-08 15:22 ` Andrew Cooper
2015-04-08 15:47 ` Ian Jackson
2015-04-08 15:01 ` [PATCH 3/4] libxenstat: always free qmp_stats Wei Liu
2015-04-08 15:49 ` Ian Jackson
2015-04-08 15:56 ` Wei Liu
2015-04-08 15:01 ` [PATCH 4/4] libxenstat: qmp_read fix and cleanup Wei Liu
2015-04-08 15:25 ` Andrew Cooper
2015-04-08 15:47 ` Wei Liu
2015-04-08 15:52 ` Ian Jackson
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=55254794.2020806@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=carnold@suse.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@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.