xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com,
	ian.jackson@eu.citrix.com, Ian.Campbell@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v2 3/3] xenstat: handle more than 1024 domains
Date: Mon, 4 Jan 2016 16:38:06 +0000	[thread overview]
Message-ID: <20160104163806.GG12639@citrix.com> (raw)
In-Reply-To: <1451919353-11547-4-git-send-email-jgross@suse.com>

On Mon, Jan 04, 2016 at 03:55:53PM +0100, Juergen Gross wrote:
> get_domain_ids() in libxenstat used by read_attributes_qdisk() is
> limited to 1024 domains. Remove that limit.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

> ---
>  tools/xenstat/libxenstat/src/xenstat_qmp.c | 67 +++++++++++++-----------------
>  1 file changed, 29 insertions(+), 38 deletions(-)
> 
> diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c b/tools/xenstat/libxenstat/src/xenstat_qmp.c
> index 5e261af..5104afb 100644
> --- a/tools/xenstat/libxenstat/src/xenstat_qmp.c
> +++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c
> @@ -356,18 +356,6 @@ static int qmp_connect(char *path)
>  	return s;
>  }
>  
> -/* Get up to 1024 active domains */
> -static xc_domaininfo_t *get_domain_ids(xc_interface *xc_handle, int *num_doms)
> -{
> -	xc_domaininfo_t *dominfo;
> -
> -	dominfo = calloc(1024, sizeof(xc_domaininfo_t));
> -	if (dominfo == NULL)
> -		return NULL;
> -	*num_doms = xc_domain_getinfolist(xc_handle, 0, 1024, dominfo);
> -	return dominfo;
> -}
> -
>  /* Gather the qdisk statistics by querying QMP
>     Resources: http://wiki.qemu.org/QMP and qmp-commands.hx from the qemu code
>     QMP Syntax for entering command mode. This command must be issued before
> @@ -398,44 +386,47 @@ void read_attributes_qdisk(xenstat_node * node)
>  {
>  	char *cmd_mode = "{ \"execute\": \"qmp_capabilities\" }";
>  	char *query_blockstats_cmd = "{ \"execute\": \"query-blockstats\" }";
> -	xc_domaininfo_t *dominfo = NULL;
> +	xc_domaininfo_t dominfo[1024];
>  	unsigned char *qmp_stats, *val;
>  	char path[80];
>  	int i, qfd, num_doms;
> +	domid_t next_domid = 0;
>  
> -	dominfo = get_domain_ids(node->handle->xc_handle, &num_doms);
> -	if (dominfo == NULL)
> -		return;
> +	for (;;) {
> +		num_doms = xc_domain_getinfolist(node->handle->xc_handle, next_domid, 1024, dominfo);

Some lines have exceeded 80 columns. Not really your fault so no need to
resend.

Wei.

  reply	other threads:[~2016-01-04 16:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 14:55 [PATCH v2 0/3] tools: remove 1024 domain limit at some places Juergen Gross
2016-01-04 14:55 ` [PATCH v2 1/3] libxl: remove the xl list limit of 1024 domains Juergen Gross
2016-01-04 16:38   ` Wei Liu
2016-01-04 14:55 ` [PATCH v2 2/3] libxl: base libxl_list_vm() on libxl_list_domain() Juergen Gross
2016-01-04 16:38   ` Wei Liu
2016-01-04 14:55 ` [PATCH v2 3/3] xenstat: handle more than 1024 domains Juergen Gross
2016-01-04 16:38   ` Wei Liu [this message]
2016-01-15 15:35     ` Ian Campbell
2016-01-15 15:39       ` Juergen Gross
2016-01-15 15:03 ` [PATCH v2 0/3] tools: remove 1024 domain limit at some places Juergen Gross
2016-01-15 15:55 ` 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=20160104163806.GG12639@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=stefano.stabellini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).