All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: DOM0_GETDOMAININFO intended behavior
@ 2005-06-04  8:20 Ian Pratt
  2005-06-04 14:56 ` Daniel Stekloff
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Pratt @ 2005-06-04  8:20 UTC (permalink / raw)
  To: Kip Macy, Daniel Stekloff; +Cc: xen-devel

 
> :-)
> 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.

I suppose we could add a flag to indicate whether you were iterating or
wanted information on a specific domain. I think currently the only case
where we want to iterate is 'xm list'.

Ian

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: DOM0_GETDOMAININFO intended behavior
@ 2005-06-10  0:18 Macy, Kip
  0 siblings, 0 replies; 13+ messages in thread
From: Macy, Kip @ 2005-06-10  0:18 UTC (permalink / raw)
  To: Daniel Stekloff, Ian Pratt; +Cc: Kip Macy, xen-devel, Christian.Limpach

> I think the cleanest fix is just to add an 'iterate' flag to the 
> parameters in GETDOMAININFO, no?


Ok... now that I (unintentionally) went overboard on this, why not just
document how it works and leave it as is? What will the flag really buy
you? 

Behaviour consistent with the other DOM0 operations.

-Kip

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: DOM0_GETDOMAININFO intended behavior
@ 2005-06-08 10:42 Ian Pratt
  2005-06-09 22:35 ` Daniel Stekloff
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Pratt @ 2005-06-08 10:42 UTC (permalink / raw)
  To: Daniel Stekloff; +Cc: Kip Macy, xen-devel, Christian.Limpach

> > Passing a flag in to explicitly request that you want to 
> iterate would 
> > probably be an improvement to the interface. 
> 
> Instead of changing the interface and the applications, how about the
> following: If you request a specific domain id and it doesn't 
> exist, you get back the expected result. If, however, you 
> want a list of domains it works like it has been.

Hmm, I'm not sure I like this. It turns a relatively minor 'gotcha' of
the hypervisor interface into something that's more confusing: if you're
trying to iterate over domains using xc_domain_getinfo then you have to
ask for at least two domains at a time otherwise you'll get ESRCH.

I think the cleanest fix is just to add an 'iterate' flag to the
parameters in GETDOMAININFO, no?

Ian

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: DOM0_GETDOMAININFO intended behavior
@ 2005-06-04 21:51 Ian Pratt
  2005-06-05  0:17 ` Kip Macy
  2005-06-06 22:28 ` Daniel Stekloff
  0 siblings, 2 replies; 13+ messages in thread
From: Ian Pratt @ 2005-06-04 21:51 UTC (permalink / raw)
  To: Daniel Stekloff, xen-devel, Christian.Limpach; +Cc: Kip Macy

 
> You're right, it isn't difficult to check what is returned - 
> provided you know what to expect. If you're new, however, to 
> the API and unfamiliar with the fact that it returns the next 
> domain in the line, you could hit what we just hit. We built 
> an application to use the interface and our tests returned 
> some odd behavior. We had to delve deeper to find out if this 
> was correct or not. 

You're not the first person to be caught out by this -- I seem to recall
that xenctx forgets to do the domid check too.

Passing a flag in to explicitly request that you want to iterate would
probably be an improvement to the interface.

Ian

> The current behavior is just not obvious. Perhaps just 
> documenting it in the code and the manual is enough so others 
> don't hit this. 
> 
> Thanks,
> 
> Dan
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread
* DOM0_GETDOMAININFO intended behavior
@ 2005-06-03 23:18 Daniel Stekloff
  2005-06-04  0:43 ` Kip Macy
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Stekloff @ 2005-06-03 23:18 UTC (permalink / raw)
  To: xen-devel


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-06-10  0:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-04  8:20 DOM0_GETDOMAININFO intended behavior Ian Pratt
2005-06-04 14:56 ` Daniel Stekloff
2005-06-04 19:42   ` Christian Limpach
2005-06-04 20:48     ` Daniel Stekloff
  -- strict thread matches above, loose matches on Subject: below --
2005-06-10  0:18 Macy, Kip
2005-06-08 10:42 Ian Pratt
2005-06-09 22:35 ` Daniel Stekloff
2005-06-04 21:51 Ian Pratt
2005-06-05  0:17 ` Kip Macy
2005-06-06 22:28 ` Daniel Stekloff
2005-06-03 23:18 Daniel Stekloff
2005-06-04  0:43 ` Kip Macy
2005-06-04  2:24   ` Anthony Liguori

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.