From: Anthony Liguori <aliguori@us.ibm.com>
To: "Cihula, Joseph" <joseph.cihula@intel.com>
Cc: Xen-devel@lists.xensource.com
Subject: Re: [PATCH] DOM0_GETDOMAININFO hypercall support for DOMID_SELF
Date: Fri, 16 Dec 2005 20:09:11 -0600 [thread overview]
Message-ID: <43A37347.5080309@us.ibm.com> (raw)
In-Reply-To: <CA95C29D57188841ABB072EA7357C00D0A7264E7@orsmsx402.amr.corp.intel.com>
Cihula, Joseph wrote:
>The attached (and following) patch allows a privileged domain to use the
>DOM0_GETDOMAININFO dom0_op (and by extension, userspace apps to use
>xc_domain_getinfo()) to query about themselves by specifying the domid
>as DOMID_SELF.
>
>Most importantly, this allows the domain to determine its own domid.
>
>
If you want to find out your domid (you'll have to be very careful wrt
save/restore/migrate btw) what you can do today is:
1) Copy libxenctrl.so.3.0.0, libxenstore.so, and xenstore-read into your
guest.
2) xenstore-read domid
This will work in any type of domain. You can also just use libxenstore
directly (just make sure to use xs_domain_open()).
Regards,
Anthony Liguori
>Signed-off-by: joseph.cihula@intel.com
>
>diff -r 6ee4c16bfdec xen/common/dom0_ops.c
>--- a/xen/common/dom0_ops.c Fri Dec 16 17:58:21 2005
>+++ b/xen/common/dom0_ops.c Fri Dec 16 18:40:39 2005
>@@ -358,12 +358,17 @@
> case DOM0_GETDOMAININFO:
> {
> struct domain *d;
>+ domid_t dom;
>+
>+ dom = op->u.getdomaininfo.domain;
>+ if ( dom == DOMID_SELF )
>+ dom = current->domain->domain_id;
>
> read_lock(&domlist_lock);
>
> for_each_domain ( d )
> {
>- if ( d->domain_id >= op->u.getdomaininfo.domain )
>+ if ( d->domain_id >= dom )
> break;
> }
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel
>
>
next prev parent reply other threads:[~2005-12-17 2:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-17 1:39 [PATCH] DOM0_GETDOMAININFO hypercall support for DOMID_SELF Cihula, Joseph
2005-12-17 2:09 ` Anthony Liguori [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-12-17 2:19 Cihula, Joseph
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=43A37347.5080309@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=Xen-devel@lists.xensource.com \
--cc=joseph.cihula@intel.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.