RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 611824 - RFE: Expose 'virDomainMemoryPeek' and 'virDomainBlockPeek' in python bindings
Summary: RFE: Expose 'virDomainMemoryPeek' and 'virDomainBlockPeek' in python bindings
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 655920
TreeView+ depends on / blocked
 
Reported: 2010-07-06 15:10 UTC by Daniel Berrangé
Modified: 2016-04-26 16:30 UTC (History)
13 users (show)

Fixed In Version: libvirt-0.9.9-1.el6
Doc Type: Enhancement
Doc Text:
No documentation needed.
Clone Of: 492683
Environment:
Last Closed: 2012-06-20 06:23:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Comment 8 Osier Yang 2011-05-25 12:47:07 UTC
It's still not supported in upstream.

Comment 10 Nan Zhang 2011-11-29 06:05:33 UTC
Test with libvirt-0.9.4-23.el6.x86_64, doesn't find this two methods 'virDomainMemoryPeek' and 'virDomainBlockPeek'.

# nm -a -D /usr/lib64/python2.6/site-packages/libvirtmod.so | grep Peek

# nm -a -D /usr/lib64/python2.6/site-packages/libvirtmod_qemu.so | grep Peek

Comment 11 Osier Yang 2011-12-15 13:04:13 UTC
patch committed to upstream.

commit d758e0cb64e4a02a2f51de892fca4159952ac027
Author: Osier Yang <jyang>
Date:   Thu Dec 15 21:01:33 2011 +0800

    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

Comment 13 Wayne Sun 2012-01-10 10:19:00 UTC
# rpm -q libvirt libvirt-python
libvirt-0.9.9-1.el6.x86_64
libvirt-python-0.9.9-1.el6.x86_64

# nm -a -D /usr/lib64/python2.6/site-packages/libvirtmod.so | grep MemoryPeek
                 U virDomainMemoryPeek

1. start a domain
# virsh list
 Id Name                 State
----------------------------------
 53 rhel6u2              running

2. check
# python
Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) 
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open(None)
>>> dom = conn.lookupByName('rhel6u2')
>>> dom.memoryPeek(0, 32, libvirt.VIR_MEMORY_VIRTUAL)
'\xd0\x93\xb6\xbb9\x7f\x00\x00\r\x00\x00\x00\x00\x00\x00\x00x\x01\x00\x00\x00\x00\x00\x00\xb0\x93\xb6\xbb9\x7f\x00\x00'
>>> dom.memoryPeek(0, 32, libvirt.VIR_MEMORY_PHYSICAL)
'S\xff\x00\xf0S\xff\x00\xf0\xc3\xe2\x00\xf0S\xff\x00\xf0S\xff\x00\xf0S\xff\x00\xf0S\xff\x00\xf0S\xff\x00\xf0'
>>> 

so, this is fixed

Comment 14 Wayne Sun 2012-01-10 10:32:15 UTC
(In reply to comment #13)
> # rpm -q libvirt libvirt-python
> libvirt-0.9.9-1.el6.x86_64
> libvirt-python-0.9.9-1.el6.x86_64
> 
> # nm -a -D /usr/lib64/python2.6/site-packages/libvirtmod.so | grep MemoryPeek
>                  U virDomainMemoryPeek
> 
> 1. start a domain
> # virsh list
>  Id Name                 State
> ----------------------------------
>  53 rhel6u2              running
> 
> 2. check
> # python
> Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) 
> [GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import libvirt
> >>> conn = libvirt.open(None)
> >>> dom = conn.lookupByName('rhel6u2')
> >>> dom.memoryPeek(0, 32, libvirt.VIR_MEMORY_VIRTUAL)
> '\xd0\x93\xb6\xbb9\x7f\x00\x00\r\x00\x00\x00\x00\x00\x00\x00x\x01\x00\x00\x00\x00\x00\x00\xb0\x93\xb6\xbb9\x7f\x00\x00'
> >>> dom.memoryPeek(0, 32, libvirt.VIR_MEMORY_PHYSICAL)
> 'S\xff\x00\xf0S\xff\x00\xf0\xc3\xe2\x00\xf0S\xff\x00\xf0S\xff\x00\xf0S\xff\x00\xf0S\xff\x00\xf0S\xff\x00\xf0'
> >>> 
> 

for blockPeek:

# nm -a -D /usr/lib64/python2.6/site-packages/libvirtmod.so | grep BlockPeek
                 U virDomainBlockPeek

>>> dom.blockPeek('hda', 0, 10, 0)
'\xfa\xb8\x00\x10\x8e\xd0\xbc\x00\xb0\xb8'
>>> dom.blockPeek('hda', 10, 10, 0)
'\x00\x00\x8e\xd8\x8e\xc0\xfb\xbe\x00|'


> so, this is fixed

Comment 15 Osier Yang 2012-05-04 09:31:26 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.

Comment 17 errata-xmlrpc 2012-06-20 06:23:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html


Note You need to log in before you can comment on or make changes to this bug.