• O
    python: Expose blockPeek and memoryPeek in Python binding · d758e0cb
    Osier Yang 提交于
    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
    d758e0cb
libvirt-override-api.xml 27.8 KB