[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] dump-guest-memory.py: fix python 2 support
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] dump-guest-memory.py: fix python 2 support |
Date: |
Wed, 17 Jan 2018 08:59:14 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 01/17/2018 08:18 AM, Laszlo Ersek wrote:
> On 01/17/18 12:44, Marc-André Lureau wrote:
>> Python GDB support may use Python 2 or 3.
>>
>> Inferior.read_memory() may return a buffer with Python 2 or a
>> memoryview with Python 3 (see also
>> https://sourceware.org/gdb/onlinedocs/gdb/Inferiors-In-Python.html)
>>
>> The elf.add_vmcoreinfo_note() method expect a byte string, but Python 2
>> buffer doesn't provide the tobyes() method. Wrap the read_memory()
>> result to a memoryview, available in Python 2.7. (if the return object
>> is already a memoryview, this adds a useless identity view on top)
>
> OOP is awesome.
>
>>
>> Fixes a regression introduced with commit
>> d23bfa91b7789534d16ede6cb7d925bfac3f3c4c ("add vmcoreinfo").
>
> Do you want to CC stable? Commit d23bfa91b778 is part of v2.11.0.
Configure says we still support python 2.6; does this still work there?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature