Difference between revisions of "XenStore"

From Xen
(Script only works in bash, not actually in more compliant implementations like dash.)
(Replace shell script with the oneliner which does the same thing)
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
   
 
__NOTOC__
 
__NOTOC__
[[XenStore]] is an information storage space shared between domains. It is meant for configuration and status information rather than for large data transfers. Each domain gets its own path in the store, which is somewhat similar in spirit to procfs. When values are changed in the store, the appropriate drivers are notified. For more information and a guide to developing with [[XenStore]], see [[XenBus]].
+
[[XenStore]] is an information storage space shared between domains maintained by the [[Xenstored]]. It is meant for configuration and status information rather than for large data transfers. Each domain gets its own path in the store, which is somewhat similar in spirit to procfs. When values are changed in the store, the appropriate drivers are notified. For more information and a guide to developing with [[XenStore]], see [[XenBus]].
   
 
You can find more about the data stored in [[XenStore]] at [[XenStoreReference]].
 
You can find more about the data stored in [[XenStore]] at [[XenStoreReference]].
   
A handy shell script to dump the xenstore :
+
You can dump the contents of the xenstore using the <code>xenstore-ls</code> tool.
 
   
 
<pre><nowiki>
 
<pre><nowiki>
  +
# xenstore-ls
#!/bin/bash
 
  +
local = ""
  +
domain = ""
  +
0 = ""
  +
name = "Domain-0"
  +
device-model = ""
  +
0 = ""
  +
state = "running"
  +
memory = ""
  +
target = "524288"
  +
static-max = "524288"
  +
freemem-slack = "1254331"
  +
libxl = ""
  +
disable_udev = "1"
  +
vm = ""
  +
libxl = ""
  +
</nowiki></pre>
   
  +
or with <code>-f</code> to produce a flattened output
function dumpkey() {
 
local param=${1}
 
local key
 
local result
 
result=$(xenstore-list ${param})
 
if [ "${result}" != "" ] ; then
 
for key in ${result} ; do dumpkey ${param}/${key} ; done
 
else
 
echo -n ${param}'='
 
xenstore-read ${param}
 
fi
 
}
 
   
  +
<pre><nowiki>
for key in /vm /local/domain /tool ; do dumpkey ${key} ; done
 
  +
# xenstore-ls -f
  +
/local = ""
  +
/local/domain = ""
  +
/local/domain/0 = ""
  +
/local/domain/0/name = "Domain-0"
  +
/local/domain/0/device-model = ""
  +
/local/domain/0/device-model/0 = ""
  +
/local/domain/0/device-model/0/state = "running"
  +
/local/domain/0/memory = ""
  +
/local/domain/0/memory/target = "524288"
  +
/local/domain/0/memory/static-max = "524288"
  +
/local/domain/0/memory/freemem-slack = "1254331"
  +
/local/domain/0/libxl = ""
  +
/local/domain/0/libxl/disable_udev = "1"
  +
/vm = ""
  +
/libxl = ""
 
</nowiki></pre>
 
</nowiki></pre>
  +
   
 
[[Category:Xen]]
 
[[Category:Xen]]

Latest revision as of 09:59, 25 February 2015


XenStore is an information storage space shared between domains maintained by the Xenstored. It is meant for configuration and status information rather than for large data transfers. Each domain gets its own path in the store, which is somewhat similar in spirit to procfs. When values are changed in the store, the appropriate drivers are notified. For more information and a guide to developing with XenStore, see XenBus.

You can find more about the data stored in XenStore at XenStoreReference.

You can dump the contents of the xenstore using the xenstore-ls tool.

# xenstore-ls 
local = ""
 domain = ""
  0 = ""
   name = "Domain-0"
   device-model = ""
    0 = ""
     state = "running"
   memory = ""
    target = "524288"
    static-max = "524288"
    freemem-slack = "1254331"
   libxl = ""
    disable_udev = "1"
vm = ""
libxl = ""

or with -f to produce a flattened output

# xenstore-ls -f
/local = ""
/local/domain = ""
/local/domain/0 = ""
/local/domain/0/name = "Domain-0"
/local/domain/0/device-model = ""
/local/domain/0/device-model/0 = ""
/local/domain/0/device-model/0/state = "running"
/local/domain/0/memory = ""
/local/domain/0/memory/target = "524288"
/local/domain/0/memory/static-max = "524288"
/local/domain/0/memory/freemem-slack = "1254331"
/local/domain/0/libxl = ""
/local/domain/0/libxl/disable_udev = "1"
/vm = ""
/libxl = ""
Languages Language: [[::XenStore|English]]  • [[::XenStore/fr|français]]