From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kip Macy Subject: Re: DOM0_GETDOMAININFO intended behavior Date: Fri, 3 Jun 2005 17:43:44 -0700 Message-ID: References: <1117840723.11942.12.camel@w-stekloff.beaverton.ibm.com> Reply-To: Kip Macy Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1117840723.11942.12.camel@w-stekloff.beaverton.ibm.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Daniel Stekloff Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org :-)=20 I asked the same question a week or two ago and yes it is intended. It provides for easy iteration. I think it is kind of a hackish interface as it isn't uniform with *all* the other DOM0 calls. However, it works and once you know to check the domid return value your code will work as expected. -Kip On 6/3/05, Daniel Stekloff wrote: >=20 > Hi, >=20 > Is it intended behavior for DOM0_GETDOMAININFO to return the next > domain's info if a requested domain doesn't exist? >=20 > In xeno-unstable - xen/common/dom0_ops.c - lines 310-325: >=20 > for_each_domain ( d ) > { > if ( d->domain_id >=3D op->u.getdomaininfo.domain ) > break; > } >=20 > if ( (d =3D=3D NULL) || !get_domain(d) ) > { > read_unlock(&domlist_lock); > ret =3D -ESRCH; > break; > } >=20 > read_unlock(&domlist_lock); >=20 > op->u.getdomaininfo.domain =3D d->domain_id; >=20 >=20 >=20 > If, as an example, I request info for domain 2 that doesn't exist > anymore and a higher domain number does exist, xen will return the next > domain's information rather than an error telling me domain 2 doesn't > exist. >=20 > Is this correct? >=20 > I noticed that libxc's xc_domain_getinfo() is built to use this when > grabbing multiple domain information. I want to know if we need to fix > vm-list to check what's returned or if this is unwanted behavior in the > library and hypervisor. >=20 > Thanks, >=20 > Dan >=20 >=20 >=20 >=20 >=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >