All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc-Andre Lureau <mlureau@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Eric Blake" <eblake@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL 0/1] Dump patches
Date: Fri, 19 Jan 2018 17:27:35 +0100	[thread overview]
Message-ID: <CAMxuvaxQnjNjVRBWcfVeN=f3G=8eL8XB_v_FZJKicP4_-tWyAw@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA8tuBBcdOJCnUSUVQbXqJ0RU9NA2rGMv_RBcCWKO2QQrA@mail.gmail.com>

On Fri, Jan 19, 2018 at 5:21 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 19 January 2018 at 16:08, Marc-Andre Lureau <mlureau@redhat.com> wrote:
>> Hi
>>
>> On Fri, Jan 19, 2018 at 4:29 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>>> On 19 January 2018 at 15:24, Peter Maydell <peter.maydell@linaro.org> wrote:
>>>> On 19 January 2018 at 14:35, Marc-Andre Lureau <mlureau@redhat.com> wrote:
>>>>> I have not found how to translate a python 'buffer' to a bytes string
>>>>> in 2.6.
>>>>
>>>> A local python expert suggests that "bytes(buffer)" should work.
>>>
>>> ...and that it ought to work if handed a memoryview too, so do we
>>> just want
>>>
>>>    self.elf.add_vmcoreinfo_note(bytes(vmcoreinfo))
>>>
>>
>> Yes, I tested on 2.6 and 3.6, it works. I'll send a new patch.
>
> Testing 2.7 as well would probably not be a bad plan. Apparently
> this works because:
>  * on python 3, bytes(memoryview) and memoryview.to_bytes() are the same
>  * gdb gives us a memoryview only if python 3
>  * so we don't have to handle the case of getting a memoryview and
>    being python 2 (in which case we would need to use memoryview.to_bytes()
>    as bytes() would do the wrong thing)

I just tested with 2.7 as well, works fine too.

Updated patch sent.

  reply	other threads:[~2018-01-19 16:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 14:47 [Qemu-devel] [PULL 0/1] Dump patches Marc-André Lureau
2018-01-17 14:47 ` [Qemu-devel] [PULL 1/1] dump-guest-memory.py: fix python 2 support Marc-André Lureau
2018-01-17 15:02 ` [Qemu-devel] [PULL 0/1] Dump patches Eric Blake
2018-01-19 14:29   ` Peter Maydell
2018-01-19 14:35     ` Marc-Andre Lureau
2018-01-19 14:56       ` Eric Blake
2018-01-19 15:24       ` Peter Maydell
2018-01-19 15:29         ` Peter Maydell
2018-01-19 16:08           ` Marc-Andre Lureau
2018-01-19 16:21             ` Peter Maydell
2018-01-19 16:27               ` Marc-Andre Lureau [this message]
2018-01-20 20:03 Marc-André Lureau
2018-01-22 12:22 ` Peter Maydell
2018-02-01 11:16 Marc-André Lureau
2018-02-02 11:38 ` Peter Maydell
2019-02-06 14:58 Marc-André Lureau
2019-02-07 14:54 ` Peter Maydell
2019-02-07 19:18 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMxuvaxQnjNjVRBWcfVeN=f3G=8eL8XB_v_FZJKicP4_-tWyAw@mail.gmail.com' \
    --to=mlureau@redhat.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.