From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: DOM0_GETDOMAININFO intended behavior Date: Fri, 03 Jun 2005 21:24:34 -0500 Message-ID: <42A110E2.6030907@us.ibm.com> References: <1117840723.11942.12.camel@w-stekloff.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Kip Macy Cc: Daniel Stekloff , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Kip Macy wrote: >:-) >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. > > It's always concerned me that something there isn't an atomic interface for getting all running domain information. I've not been able to figure out a situation though where it would create a problem. It just seems kind of odd that you could do an xc_domain_getinfo of an array of dominfo's and a portion of the array might not be valid when other portions of the array are. It's possible that the call could return two domains that never actually existed together at the same moment in time. Again, I don't think it's a race condition but it's just odd. Regards, Anthony Liguori > -Kip > >On 6/3/05, Daniel Stekloff wrote: > > >>Hi, >> >>Is it intended behavior for DOM0_GETDOMAININFO to return the next >>domain's info if a requested domain doesn't exist? >> >>In xeno-unstable - xen/common/dom0_ops.c - lines 310-325: >> >> for_each_domain ( d ) >> { >> if ( d->domain_id >= op->u.getdomaininfo.domain ) >> break; >> } >> >> if ( (d == NULL) || !get_domain(d) ) >> { >> read_unlock(&domlist_lock); >> ret = -ESRCH; >> break; >> } >> >> read_unlock(&domlist_lock); >> >> op->u.getdomaininfo.domain = d->domain_id; >> >> >> >>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. >> >>Is this correct? >> >>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. >> >>Thanks, >> >>Dan >> >> >> >> >> >> >> >>_______________________________________________ >>Xen-devel mailing list >>Xen-devel@lists.xensource.com >>http://lists.xensource.com/xen-devel >> >> >> > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel > > >