xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Fajar A. Nugraha" <fajar@fajar.net>
To: 胡少龙 <sunofblack@yahoo.cn>
Cc: xen-devel@lists.xensource.com
Subject: Re: How does domain0 export information to guest through xenstore
Date: Mon, 9 Aug 2010 11:40:05 +0700	[thread overview]
Message-ID: <AANLkTinH8pu0Ee2N0r_yki-=R44oWoPMz_9t0TdDAmZ6@mail.gmail.com> (raw)
In-Reply-To: <911857.94436.qm@web92403.mail.cnh.yahoo.com>

On Mon, Aug 9, 2010 at 7:31 AM, 胡少龙 <sunofblack@yahoo.cn> wrote:
>
> Hi,
>     I am tring to write xenstore some information ,so that a guest can read, if i simply xenstore-write /foo "123" in domain 0, guest have not the permission to read this ,and guest domain number are dynamic, so i can not write a program to write /local/domain/X, which X is the domain id i want to export information to, can i ?
>     So, is there a path (a static path,without domain number)that i write to in domain 0, and guests have the permission to read ?

You could make use of virsh to convert domU name to id. Something like this:

On dom0:
# virsh domid domUname
41
# DOMU_ID=`virsh domid domUname`
# xenstore-write /local/domain/${DOMU_ID}/my-data "test-data"
# xenstore-read /local/domain/${DOMU_ID}/my-data
test-data

on domU:
# xenstore-read my-data
test-data

-- 
Fajar

      reply	other threads:[~2010-08-09  4:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09  0:31 How does domain0 export information to guest through xenstore 胡少龙  
2010-08-09  4:40 ` Fajar A. Nugraha [this message]

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='AANLkTinH8pu0Ee2N0r_yki-=R44oWoPMz_9t0TdDAmZ6@mail.gmail.com' \
    --to=fajar@fajar.net \
    --cc=sunofblack@yahoo.cn \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).