]> git.ipfire.org Git - thirdparty/libvirt.git/commit
python: Expose blockPeek and memoryPeek in Python binding
authorOsier Yang <jyang@redhat.com>
Thu, 15 Dec 2011 13:01:33 +0000 (21:01 +0800)
committerOsier Yang <jyang@redhat.com>
Thu, 15 Dec 2011 13:01:33 +0000 (21:01 +0800)
commitd758e0cb64e4a02a2f51de892fca4159952ac027
tree6973fe04fe69634b51c753133991b017749000c7
parent6948b725e78016e45b846a17b89fafb69965be51
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
python/generator.py
python/libvirt-override-api.xml
python/libvirt-override.c