diff options
author | Osier Yang <jyang@redhat.com> | 2011-12-15 21:01:33 +0800 |
---|---|---|
committer | Osier Yang <jyang@redhat.com> | 2011-12-15 21:01:33 +0800 |
commit | 2bafe73ba23fc8b12b29fd01e253501ffce4886f (patch) | |
tree | f7ac703778f1d5c3c6b4859119948d1442a97c7d /libvirt-override-api.xml | |
parent | d5d9acdd862c00e5316f6d60abd20cb246af8745 (diff) | |
download | libvirt-python-v6-2bafe73ba23fc8b12b29fd01e253501ffce4886f.tar.gz libvirt-python-v6-2bafe73ba23fc8b12b29fd01e253501ffce4886f.tar.xz libvirt-python-v6-2bafe73ba23fc8b12b29fd01e253501ffce4886f.zip |
python: Expose blockPeek and memoryPeek in Python binding
A simple example to show how to use it:
\#! /usr/bin/python
import os
import sys
import libvirt
disk = "/var/lib/libvirt/images/test.img"
conn = libvirt.open(None)
dom = conn.lookupByName('test')
mem_contents = dom.memoryPeek(0, 32, libvirt.VIR_MEMORY_VIRTUAL);
sys.stdout.write(mem_contents)
% python test.py | hexdump
0000000 1660 0209 0000 0000 0000 0000 0000 0000
0000010 0000 0000 0000 0000 d3a0 01d0 0000 0000
0000020
Diffstat (limited to 'libvirt-override-api.xml')
-rw-r--r-- | libvirt-override-api.xml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml index 7c18763..07e4a78 100644 --- a/libvirt-override-api.xml +++ b/libvirt-override-api.xml @@ -405,5 +405,22 @@ <arg name='flags' type='unsigned int' info='an OR'ed set of virDomainModificationImpact'/> <return type='int' info='0 in case of success, -1 in case of failure'/> </function> + <function name='virDomainBlockPeek' file='python'> + <info>Read the contents of domain's disk device</info> + <arg name='dom' type='virDomainPtr' info='pointer to the domain'/> + <arg name='disk' type='const char *' info='disk name'/> + <arg name='offset' type='unsigned long long' info='offset within block device'/> + <arg name='size' type='size_t' info='size to read'/> + <arg name='flags' type='unsigned int' info='unused, always pass 0'/> + <return type='char *' info='the returned buffer or None in case of error'/> + </function> + <function name='virDomainMemoryPeek' file='python'> + <info>Read the contents of domain's memory</info> + <arg name='dom' type='virDomainPtr' info='pointer to the domain'/> + <arg name='start' type='unsigned long long' info='start of memory to peek'/> + <arg name='size' type='size_t' info='size of memory to peek'/> + <arg name='flags' type='unsigned int' info='an OR'ed set of virDomainMemoryFlags'/> + <return type='char *' info='the returned buffer or None in case of error'/> + </function> </symbols> </api> |