All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Baojun Wang <wangbj@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH V4 1/1] qmp: add pmemload command
Date: Wed, 09 Apr 2014 11:02:18 -0600	[thread overview]
Message-ID: <53457D1A.7000602@redhat.com> (raw)
In-Reply-To: <1397062459-4141-1-git-send-email-wangbj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]

On 04/09/2014 10:54 AM, Baojun Wang wrote:
> Signed-off-by: Baojun Wang <wangbj@gmail.com>

You lost this part of your commit message, which gives more details
about the 'why' (the subject line covers the 'what', but it is often the
'why' that is most needed when reviewing a commit later).  Your earlier
mail had:

I found this could be useful to have qemu-softmmu as a cross debugger
(launch
with -s -S command line option), then if we can have a command to load guest
physical memory, we can use cross gdb to do some target debug which gdb
cannot
do directly.


>  
> +void qmp_pmemload(int64_t addr, int64_t size, const char *filename,
> +                  Error **errp)
> +{
> +    FILE *f;
> +    uint32_t l;
> +    uint8_t buf[1024];
> +
> +    f = fopen(filename, "rb");

I still think that fopen()/fread() is wrong, and that you should be
using qemu_open()/read() - that way, libvirt could pass in a file
descriptor and use qemu's already-existing /dev/fdset/nnn support rather
than forcing qemu to open something from the filesystem.


> +++ b/hmp-commands.hx
> @@ -809,6 +809,19 @@ save to disk physical memory dump starting at @var{addr} of size @var{size}.
>  ETEXI
>  
>      {
> +        .name       = "pmemload",
> +        .args_type  = "val:l,size:i,filename:s",
> +        .params     = "addr size file",
> +        .help       = "load from disk physical memory dump starting at 'addr' of size 'size'",
> +        .mhandler.cmd = hmp_pmemload,

And I still think that you should list filename first, with val and size
optional at the end.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Eric Blake <eblake@redhat.com>
To: Baojun Wang <wangbj@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH V4 1/1] qmp: add pmemload command
Date: Wed, 09 Apr 2014 11:02:18 -0600	[thread overview]
Message-ID: <53457D1A.7000602@redhat.com> (raw)
In-Reply-To: <1397062459-4141-1-git-send-email-wangbj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]

On 04/09/2014 10:54 AM, Baojun Wang wrote:
> Signed-off-by: Baojun Wang <wangbj@gmail.com>

You lost this part of your commit message, which gives more details
about the 'why' (the subject line covers the 'what', but it is often the
'why' that is most needed when reviewing a commit later).  Your earlier
mail had:

I found this could be useful to have qemu-softmmu as a cross debugger
(launch
with -s -S command line option), then if we can have a command to load guest
physical memory, we can use cross gdb to do some target debug which gdb
cannot
do directly.


>  
> +void qmp_pmemload(int64_t addr, int64_t size, const char *filename,
> +                  Error **errp)
> +{
> +    FILE *f;
> +    uint32_t l;
> +    uint8_t buf[1024];
> +
> +    f = fopen(filename, "rb");

I still think that fopen()/fread() is wrong, and that you should be
using qemu_open()/read() - that way, libvirt could pass in a file
descriptor and use qemu's already-existing /dev/fdset/nnn support rather
than forcing qemu to open something from the filesystem.


> +++ b/hmp-commands.hx
> @@ -809,6 +809,19 @@ save to disk physical memory dump starting at @var{addr} of size @var{size}.
>  ETEXI
>  
>      {
> +        .name       = "pmemload",
> +        .args_type  = "val:l,size:i,filename:s",
> +        .params     = "addr size file",
> +        .help       = "load from disk physical memory dump starting at 'addr' of size 'size'",
> +        .mhandler.cmd = hmp_pmemload,

And I still think that you should list filename first, with val and size
optional at the end.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-04-09 17:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 19:30 [Qemu-trivial] [PATCH V3 1/1] Add pmemsave command for both monitor and qmp, which could be useful to have qemu-softmmu as a cross debugger to load guest physical memory Baojun Wang
2014-04-08 19:30 ` [Qemu-devel] " Baojun Wang
2014-04-08 19:42 ` [Qemu-trivial] " Eric Blake
2014-04-08 19:42   ` [Qemu-devel] " Eric Blake
2014-04-08 23:29   ` [Qemu-trivial] " Baojun Wang
2014-04-08 23:29     ` [Qemu-devel] " Baojun Wang
2014-04-09 16:54     ` [Qemu-trivial] [PATCH V4 1/1] qmp: add pmemload command Baojun Wang
2014-04-09 16:54       ` [Qemu-devel] " Baojun Wang
2014-04-09 17:02       ` Eric Blake [this message]
2014-04-09 17:02         ` Eric Blake
2014-04-09 17:49         ` [Qemu-trivial] [PATCH V5 " Baojun Wang
2014-04-09 17:49           ` [Qemu-devel] " Baojun Wang
2014-04-27  9:18           ` [Qemu-trivial] " Michael Tokarev
2014-04-28  6:30             ` [Qemu-trivial] [Qemu-devel] " Markus Armbruster
2014-04-30 18:00             ` [Qemu-trivial] " Baojun Wang

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=53457D1A.7000602@redhat.com \
    --to=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=wangbj@gmail.com \
    /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.