KUWAMURA Shin''ya
2006-Jul-04 05:37 UTC
[Xen-devel] [PATCH] xenmon: remove magic number "31" (the idle domain)
Hi, This patch removes the magic number "31" for readability. The number "31" means the idle domain ID. In detail: - display the idle domain ID with "Idle" instead of "31" - write to the file "log-idle.log" instead of "log-dom31.log". Signed-off-by: KUWAMURA Shin''ya <kuwa@jp.fujitsu.com> Thanks, -- KUWAMURA Shin''ya _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jul-04 07:06 UTC
Re: [Xen-devel] [PATCH] xenmon: remove magic number "31" (the idle domain)
On 4 Jul 2006, at 06:37, KUWAMURA Shin''ya wrote:> This patch removes the magic number "31" for readability. The number > "31" means the idle domain ID. > > In detail: > - display the idle domain ID with "Idle" instead of "31" > - write to the file "log-idle.log" instead of "log-dom31.log". > > Signed-off-by: KUWAMURA Shin''ya <kuwa@jp.fujitsu.com>Where does the magic number ''31'' come from in the first place? That''s not the number Xen uses. It could conflict with the domain id of a non-idle domain. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
KUWAMURA Shin''ya
2006-Jul-04 07:48 UTC
Re: [Xen-devel] [PATCH] xenmon: remove magic number "31" (the idle domain)
Hi Keir,>>>>> On Tue, 4 Jul 2006 08:06:57 +0100 >>>>> Keir.Fraser@cl.cam.ac.uk(Keir Fraser) said: > > > On 4 Jul 2006, at 06:37, KUWAMURA Shin''ya wrote: > > > This patch removes the magic number "31" for readability. The number > > "31" means the idle domain ID. > > Where does the magic number ''31'' come from in the first place? That''s > not the number Xen uses. It could conflict with the domain id of a > non-idle domain."31" comes from xenmon.py and xenbaked.h. xenmon.py:38: NDOMAINS = 32 xenbaked.h:42 #define NDOMAINS 32 Notice that 31 is NDOMAINS-1. Therefore, xenmon supports only up to 32 domains. Thanks, -- KUWAMURA Shin''ya _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jul-04 07:57 UTC
Re: [Xen-devel] [PATCH] xenmon: remove magic number "31" (the idle domain)
On 4 Jul 2006, at 08:48, KUWAMURA Shin''ya wrote:>> Where does the magic number ''31'' come from in the first place? That''s >> not the number Xen uses. It could conflict with the domain id of a >> non-idle domain. > > "31" comes from xenmon.py and xenbaked.h. > xenmon.py:38: > NDOMAINS = 32 > > xenbaked.h:42 > #define NDOMAINS 32 > > Notice that 31 is NDOMAINS-1. > > Therefore, xenmon supports only up to 32 domains.That''s poor, since it in fact only really supports the first 31 domains created on a system (domain ids don''t necessarily quickly get reused; and 32nd domid is used as sentinel to indicate idle). It shouldn''t be hard to use a data structure more complicated than (presumably) a small array indexed by domid. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Rob Gardner
2006-Jul-05 16:22 UTC
Re: [Xen-devel] [PATCH] xenmon: remove magic number "31" (the idle domain)
Keir Fraser wrote:>> Therefore, xenmon supports only up to 32 domains. > > That''s poor, since it in fact only really supports the first 31 > domains created on a system (domain ids don''t necessarily quickly get > reused; and 32nd domid is used as sentinel to indicate idle). It > shouldn''t be hard to use a data structure more complicated than > (presumably) a small array indexed by domid.I know about this problem. I''ve got a fix for it I prepared some time ago but never got around to submitting. I''ll integrate it with the latest source and get it sent out this week. Rob _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel