All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stekloff <dsteklof@us.ibm.com>
To: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>
Cc: Kip Macy <kip.macy@gmail.com>,
	xen-devel@lists.xensource.com, Christian.Limpach@cl.cam.ac.uk
Subject: RE: DOM0_GETDOMAININFO intended behavior
Date: Mon, 06 Jun 2005 15:28:22 -0700	[thread overview]
Message-ID: <1118096902.5094.26.camel@w-stekloff.beaverton.ibm.com> (raw)
In-Reply-To: <A95E2296287EAD4EB592B5DEEFCE0E9D282077@liverpoolst.ad.cl.cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

On Sat, 2005-06-04 at 22:51 +0100, Ian Pratt wrote:
>  > 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.



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.

Thanks,

Dan

Signed-off-by: dsteklof@us.ibm.com



[-- Attachment #2: xc_domain_getinfo.patch --]
[-- Type: text/x-patch, Size: 591 bytes --]

--- xeno-unstable-latest/tools/libxc/xc_domain.c	2005-06-06 11:53:03.000000000 -0700
+++ xeno-unstable/tools/libxc/xc_domain.c	2005-06-06 15:28:59.000000000 -0700
@@ -83,6 +83,11 @@
         op.u.getdomaininfo.domain = (domid_t)next_domid;
         if ( (rc = do_dom0_op(xc_handle, &op)) < 0 )
             break;
+        if ( max_doms == 1 && op.u.getdomaininfo.domain != first_domid )
+        {
+            rc = -ESRCH;
+            break;
+        }
         info->domid      = (u16)op.u.getdomaininfo.domain;
 
         info->dying    = !!(op.u.getdomaininfo.flags & DOMFLAGS_DYING);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2005-06-06 22:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-04 21:51 DOM0_GETDOMAININFO intended behavior Ian Pratt
2005-06-05  0:17 ` Kip Macy
2005-06-06 22:28 ` Daniel Stekloff [this message]
  -- 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  8:20 Ian Pratt
2005-06-04 14:56 ` Daniel Stekloff
2005-06-04 19:42   ` Christian Limpach
2005-06-04 20:48     ` Daniel Stekloff
2005-06-03 23:18 Daniel Stekloff
2005-06-04  0:43 ` Kip Macy
2005-06-04  2:24   ` Anthony Liguori

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=1118096902.5094.26.camel@w-stekloff.beaverton.ibm.com \
    --to=dsteklof@us.ibm.com \
    --cc=Christian.Limpach@cl.cam.ac.uk \
    --cc=kip.macy@gmail.com \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /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 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.