[Qemu-devel] [PATCH v8 7/7] hmp: add pmemload command

2018-11-15 Thread Simon Ruderich
debug which gdb cannot do directly. This patch contains only the hmp changes of the original patch. [1]: https://lists.gnu.org/archive/html/qemu-trivial/2014-04/msg00074.html Based-on-patch-by: Baojun Wang Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich --- hmp-commands.hx

[Qemu-devel] [PATCH v8 6/7] qmp: add pmemload command

2018-11-15 Thread Simon Ruderich
eviewed-by: Eric Blake Signed-off-by: Simon Ruderich --- cpus.c | 55 ++ qapi/misc.json | 20 ++ 2 files changed, 75 insertions(+) diff --git a/cpus.c b/cpus.c index ee54595733..b80f331596 100644 --- a/cpus.c +++ b/cpus.c

[Qemu-devel] [PATCH v8 0/7] qmp: add pmemload command

2018-11-15 Thread Simon Ruderich
Hello, This time as a new thread to help patchew. The only change is to use the correct next version. Regards Simon Ruderich Simon Ruderich (7): cpus: correct coding style in qmp_memsave/qmp_pmemsave cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open cpus: use size_t in qmp_memsave

[Qemu-devel] [PATCH v8 5/7] hmp: use F for filename arguments in memsave/pmemsave

2018-11-15 Thread Simon Ruderich
This enables completion for the filename arguments. Suggested-by: Dr. David Alan Gilbert Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich --- hmp-commands.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index

[Qemu-devel] [PATCH v8 3/7] cpus: use size_t in qmp_memsave/qmp_pmemsave

2018-11-15 Thread Simon Ruderich
It's the natural type for object sizes and matches the return value of sizeof(buf). Reviewed-by: Eric Blake Signed-off-by: Simon Ruderich --- cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index c0d796f441..ee54595733 100644 --- a/cpus.c

[Qemu-devel] [PATCH v8 1/7] cpus: correct coding style in qmp_memsave/qmp_pmemsave

2018-11-15 Thread Simon Ruderich
Reviewed-by: Eric Blake Signed-off-by: Simon Ruderich --- cpus.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index a2b33ccb29..e67efbb58b 100644 --- a/cpus.c +++ b/cpus.c @@ -2394,8 +2394,9 @@ void qmp_memsave(int64_t addr, int64_t size, const char

[Qemu-devel] [PATCH v8 2/7] cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open

2018-11-15 Thread Simon Ruderich
qemu_open() allow passing file descriptors to qemu which is used in restricted environments like libvirt where open() is prohibited. Suggested-by: Eric Blake Reviewed-by: Eric Blake Signed-off-by: Simon Ruderich --- cpus.c | 20 ++-- 1 file changed, 10 insertions(+), 10

Re: [Qemu-devel] [PATCH v7 0/7] qmp: add pmemload command

2018-11-15 Thread Simon Ruderich
On Thu, Nov 15, 2018 at 07:45:29AM -0600, Eric Blake wrote: > On 11/15/18 7:22 AM, Simon Ruderich wrote: >> Hello again, >> >> Please ignore v6, I forgot one patch. I hope I got it right this >> time. > > Our automated tooling doesn't spot patches sent in repl

[Qemu-devel] [PATCH v8 4/7] hmp: use l for size argument in memsave/pmemsave

2018-11-15 Thread Simon Ruderich
i is only 32-bit. To prevent possible truncation when dumping large memory regions use l which is target long. Suggested-by: Dr. David Alan Gilbert Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich --- hmp-commands.hx | 4 ++-- hmp.c | 4 ++-- 2 files changed, 4

[Qemu-devel] [PATCH v7 7/7] hmp: add pmemload command

2018-11-15 Thread Simon Ruderich
debug which gdb cannot do directly. This patch contains only the hmp changes of the original patch. [1]: https://lists.gnu.org/archive/html/qemu-trivial/2014-04/msg00074.html Based-on-patch-by: Baojun Wang Signed-off-by: Simon Ruderich --- hmp-commands.hx | 14 ++ hmp.c

[Qemu-devel] [PATCH v7 5/7] hmp: use F for filename arguments in memsave/pmemsave

2018-11-15 Thread Simon Ruderich
This enables completion for the filename arguments. Suggested-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich --- hmp-commands.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index ff96c3ad24..2404a5210d 100644 --- a/hmp

[Qemu-devel] [PATCH v7 2/7] cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open

2018-11-15 Thread Simon Ruderich
qemu_open() allow passing file descriptors to qemu which is used in restricted environments like libvirt where open() is prohibited. Suggested-by: Eric Blake Signed-off-by: Simon Ruderich --- cpus.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a

[Qemu-devel] [PATCH v7 1/7] cpus: correct coding style in qmp_memsave/qmp_pmemsave

2018-11-15 Thread Simon Ruderich
Signed-off-by: Simon Ruderich --- cpus.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index a2b33ccb29..e67efbb58b 100644 --- a/cpus.c +++ b/cpus.c @@ -2394,8 +2394,9 @@ void qmp_memsave(int64_t addr, int64_t size, const char *filename, while

[Qemu-devel] [PATCH v7 6/7] qmp: add pmemload command

2018-11-15 Thread Simon Ruderich
Signed-off-by: Simon Ruderich --- cpus.c | 51 ++ qapi/misc.json | 20 2 files changed, 71 insertions(+) diff --git a/cpus.c b/cpus.c index ee54595733..a12076dc68 100644 --- a/cpus.c +++ b/cpus.c @@ -2445,6 +2445,

[Qemu-devel] [PATCH v7 4/7] hmp: use l for size argument in memsave/pmemsave

2018-11-15 Thread Simon Ruderich
i is only 32-bit. To prevent possible truncation when dumping large memory regions use l which is target long. Suggested-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich --- hmp-commands.hx | 4 ++-- hmp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [PATCH v7 0/7] qmp: add pmemload command

2018-11-15 Thread Simon Ruderich
. Only 5/6 requires an ack (although all mentioned issues should be fixed), all other patches were already reviewed in the last round. If there's anything else I can do to get this merged, please tell me. Regards Simon Ruderich Simon Ruderich (7): cpus: correct coding style in qmp_me

[Qemu-devel] [PATCH v7 3/7] cpus: use size_t in qmp_memsave/qmp_pmemsave

2018-11-15 Thread Simon Ruderich
It's the natural type for object sizes and matches the return value of sizeof(buf). Signed-off-by: Simon Ruderich --- cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index c0d796f441..ee54595733 100644 --- a/cpus.c +++ b/cpus.c @@ -2370,7 +2

[Qemu-devel] [PATCH v6 2/6] cpus: use size_t in qmp_memsave/qmp_pmemsave

2018-11-15 Thread Simon Ruderich
It's the natural type for object sizes and matches the return value of sizeof(buf). Signed-off-by: Simon Ruderich Reviewed-by: Eric Blake --- cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index c0d796f441..ee54595733 100644 --- a/cpus.c

[Qemu-devel] [PATCH v6 1/6] cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open

2018-11-15 Thread Simon Ruderich
qemu_open() allow passing file descriptors to qemu which is used in restricted environments like libvirt where open() is prohibited. Suggested-by: Eric Blake Signed-off-by: Simon Ruderich Reviewed-by: Eric Blake --- cpus.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[Qemu-devel] [PATCH v6 4/6] hmp: use F for filename arguments in memsave/pmemsave

2018-11-15 Thread Simon Ruderich
This enables completion for the filename arguments. Suggested-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich Reviewed-by: Dr. David Alan Gilbert --- hmp-commands.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index

[Qemu-devel] [PATCH v6 5/6] qmp: add pmemload command

2018-11-15 Thread Simon Ruderich
Signed-off-by: Simon Ruderich --- cpus.c | 55 ++ qapi/misc.json | 20 ++ 2 files changed, 75 insertions(+) diff --git a/cpus.c b/cpus.c index ee54595733..b80f331596 100644 --- a/cpus.c +++ b/cpus.c @@ -2445,6 +2445,

[Qemu-devel] [PATCH v6 3/6] hmp: use l for size argument in memsave/pmemsave

2018-11-15 Thread Simon Ruderich
i is only 32-bit. To prevent possible truncation when dumping large memory regions use l which is target long. Suggested-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich Reviewed-by: Dr. David Alan Gilbert --- hmp-commands.hx | 4 ++-- hmp.c | 4 ++-- 2 files changed, 4

[Qemu-devel] [PATCH v6 6/6] hmp: add pmemload command

2018-11-15 Thread Simon Ruderich
debug which gdb cannot do directly. This patch contains only the hmp changes of the original patch. [1]: https://lists.gnu.org/archive/html/qemu-trivial/2014-04/msg00074.html Based-on-patch-by: Baojun Wang Signed-off-by: Simon Ruderich Reviewed-by: Dr. David Alan Gilbert --- hmp-commands.hx

[Qemu-devel] [PATCH v6 0/6] qmp: add pmemload command

2018-11-15 Thread Simon Ruderich
other patches were already reviewed in the last round. If there's anything else I can do to get this merged, please tell me. Regards Simon Ruderich Simon Ruderich (6): cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open cpus: use size_t in qmp_memsave/qmp_pmemsave hmp: use l for

Re: [Qemu-devel] [PATCH v5 5/6] qmp: add pmemload command

2018-10-09 Thread Simon Ruderich
On Fri, Sep 21, 2018 at 01:02:05PM +0200, Simon Ruderich wrote: > On Tue, Aug 21, 2018 at 02:38:02PM +0200, Simon Ruderich wrote: >> Hello, >> >> I've adapted the patch to error out if a char/block device is >> used. I think that's the simplest fix for

Re: [Qemu-devel] [PATCH v5 5/6] qmp: add pmemload command

2018-09-21 Thread Simon Ruderich
On Tue, Aug 21, 2018 at 02:38:02PM +0200, Simon Ruderich wrote: > Hello, > > I've adapted the patch to error out if a char/block device is > used. I think that's the simplest fix for the issue mentioned by > Eric Blake. > > Are the any other issues remaining? Al

[Qemu-devel] [PATCH v5 5/6] qmp: add pmemload command

2018-08-21 Thread Simon Ruderich
Signed-off-by: Simon Ruderich --- Hello, I've adapted the patch to error out if a char/block device is used. I think that's the simplest fix for the issue mentioned by Eric Blake. Are the any other issues remaining? All other patches are unchanged, should I resend the whole series? Re

Re: [Qemu-devel] [PATCH v4 6/7] qmp: add pmemload command

2018-08-17 Thread Simon Ruderich
On Thu, Aug 16, 2018 at 03:01:31PM -0500, Eric Blake wrote: >> +} >> +if (!has_size) { >> +struct stat s; >> +if (fstat(fd, &s)) { >> +error_setg_errno(errp, errno, "could not fstat fd to get size"); >> +goto exit; >> +} >> +size = s.s

[Qemu-devel] [PATCH v4 7/7] hmp: add pmemload command

2018-08-16 Thread Simon Ruderich
debug which gdb cannot do directly. This patch contains only the hmp changes of the original patch. [1]: https://lists.gnu.org/archive/html/qemu-trivial/2014-04/msg00074.html Based-on-patch-by: Baojun Wang Signed-off-by: Simon Ruderich --- hmp-commands.hx | 14 ++ hmp.c

[Qemu-devel] [PATCH v4 2/7] cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open

2018-08-16 Thread Simon Ruderich
qemu_open() allow passing file descriptors to qemu which is used in restricted environments like libvirt where open() is prohibited. Suggested-by: Eric Blake Signed-off-by: Simon Ruderich --- cpus.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a

[Qemu-devel] [PATCH v4 5/7] hmp: use F for filename arguments in memsave/pmemsave

2018-08-16 Thread Simon Ruderich
This enables completion for the filename arguments. Suggested-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich --- hmp-commands.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 79c158a140..5715bd7b51 100644 --- a/hmp

[Qemu-devel] [PATCH v4 6/7] qmp: add pmemload command

2018-08-16 Thread Simon Ruderich
Signed-off-by: Simon Ruderich --- cpus.c | 51 ++ qapi/misc.json | 20 2 files changed, 71 insertions(+) diff --git a/cpus.c b/cpus.c index 243f2c0d2e..d79bf8b485 100644 --- a/cpus.c +++ b/cpus.c @@ -2369,6 +2369,

[Qemu-devel] [PATCH v4 1/7] cpus: correct coding style in qmp_memsave/qmp_pmemsave

2018-08-16 Thread Simon Ruderich
Signed-off-by: Simon Ruderich --- cpus.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index b5844b7103..125adc4da4 100644 --- a/cpus.c +++ b/cpus.c @@ -2318,8 +2318,9 @@ void qmp_memsave(int64_t addr, int64_t size, const char *filename, while

[Qemu-devel] [PATCH v4 0/7] qmp/hmp: add pmemload command

2018-08-16 Thread Simon Ruderich
Hello, Revised patch series rebased on current master which should incorporate all comments mentioned in the review. I've decided to make size and offset optional for QMP, but keep it required for HMP to make pmemload consistent with memsave/pmemsave. Regards Simon Simon Ruderich (7):

[Qemu-devel] [PATCH v4 3/7] cpus: use size_t in qmp_memsave/qmp_pmemsave

2018-08-16 Thread Simon Ruderich
It's the natural type for object sizes and matches the return value of sizeof(buf). Signed-off-by: Simon Ruderich --- cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index dd8ba36d2f..243f2c0d2e 100644 --- a/cpus.c +++ b/cpus.c @@ -2294,7 +2

[Qemu-devel] [PATCH v4 4/7] hmp: use l for size argument in memsave/pmemsave

2018-08-16 Thread Simon Ruderich
i is only 32-bit. To prevent possible truncation when dumping large memory regions use l which is target long. Suggested-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich --- hmp-commands.hx | 4 ++-- hmp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

Re: [Qemu-devel] [PATCH v3 5/5] qmp: add pmemload command

2018-08-16 Thread Simon Ruderich
On Thu, Aug 16, 2018 at 10:26:18AM +0200, Markus Armbruster wrote: >> On Thu, Aug 16, 2018 at 07:43:41AM +0200, Markus Armbruster wrote: On Fri, Aug 10, 2018 at 11:36:51AM +0100, Dr. David Alan Gilbert wrote: > Also, had you considered rearranging and making them optional, > for exampl

Re: [Qemu-devel] [PATCH v3 5/5] qmp: add pmemload command

2018-08-16 Thread Simon Ruderich
On Thu, Aug 16, 2018 at 07:43:41AM +0200, Markus Armbruster wrote: >> On Fri, Aug 10, 2018 at 11:36:51AM +0100, Dr. David Alan Gilbert wrote: >>> Also, had you considered rearranging and making them optional, >>> for example if you do: >>> >>> val:l,filename:F,offset:i?,size:i? >>> >>> I think that

Re: [Qemu-devel] [PATCH v3 5/5] qmp: add pmemload command

2018-08-15 Thread Simon Ruderich
On Wed, Aug 15, 2018 at 04:29:25PM +0200, Markus Armbruster wrote: >> For the HMP or the QMP interface? > > Both. Ok. >> If you think 'offset' is not necessary I can also drop it >> completely. > > I think it's a reasonable feature, and since you already coded it up... In that case, should size

Re: [Qemu-devel] [PATCH v3 5/5] qmp: add pmemload command

2018-08-15 Thread Simon Ruderich
On Wed, Aug 15, 2018 at 06:22:51AM +0200, Markus Armbruster wrote: >> My initial patch didn't have the offset. It was suggested by Eric >> Blake in <0a960aa8-2a3f-8667-3d46-cecf8e65e...@redhat.com>: >> >> On Tue, Apr 10, 2018 at 04:33:03PM -0500, Eric Blake wrote: >>> Do you additionally need an of

Re: [Qemu-devel] [PATCH v3 5/5] qmp: add pmemload command

2018-08-14 Thread Simon Ruderich
On Tue, Aug 14, 2018 at 05:49:12PM +0200, Markus Armbruster wrote: >> On Fri, Aug 10, 2018 at 11:36:51AM +0100, Dr. David Alan Gilbert wrote: --- a/hmp-commands.hx +++ b/hmp-commands.hx > > Subject claims "qmp: add", but the patch also adds to hmp. Recommend to > split the patch into QMP

Re: [Qemu-devel] [PATCH v3 5/5] qmp: add pmemload command

2018-08-14 Thread Simon Ruderich
On Fri, Aug 10, 2018 at 11:36:51AM +0100, Dr. David Alan Gilbert wrote: >> --- a/hmp-commands.hx >> +++ b/hmp-commands.hx >> @@ -822,6 +822,20 @@ STEXI >> @item pmemsave @var{addr} @var{size} @var{file} >> @findex pmemsave >> save to disk physical memory dump starting at @var{addr} of size @var{

Re: [Qemu-devel] [PATCH v3 5/5] qmp: add pmemload command

2018-08-14 Thread Simon Ruderich
On Thu, Aug 09, 2018 at 11:46:50AM -0500, Eric Blake wrote: > There was no 2.13 release, and this feature has missed the 3.0 deadlines, so > it would need to say 'Since: 3.1' Will do. Regards Simon -- + privacy is necessary + using gnupg http://gnupg.org + public key id: 0x92FEFDB7E44C32F9 sig

Re: [Qemu-devel] [PATCH v3 0/5] qmp: add pmemload command

2018-08-14 Thread Simon Ruderich
On Fri, Aug 10, 2018 at 08:06:11AM +0200, Markus Armbruster wrote: > You neglected to cc: maintainers. I spotted this cry for help only by > chance. > > To find maintainers to cc:, you can use get_maintainer.pl like this: > > $ scripts/get_maintainer.pl *patch > scripts/get_maintainer.pl:

Re: [Qemu-devel] [PATCH v3 0/5] qmp: add pmemload command

2018-08-09 Thread Simon Ruderich
On Mon, May 21, 2018 at 05:36:39PM +0200, Simon Ruderich wrote: > Hello, > > This is third version of this patch set, rebased on current > master. > > As I've received no answers to [1] (and I'd prefer to keep the > patch as is for now if possible) this doesn't

[Qemu-devel] [PATCH v3 5/5] qmp: add pmemload command

2018-05-21 Thread Simon Ruderich
stent with the existing pmemsave. Changing the parameter name of pmemsave is not possible without breaking the existing API. [1]: https://lists.gnu.org/archive/html/qemu-trivial/2014-04/msg00074.html Based-on-patch-by: Baojun Wang Signed-off-by: Simon Ruderich --- cpus.c

[Qemu-devel] [PATCH v3 2/5] cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open

2018-05-21 Thread Simon Ruderich
qemu_open() allows passing file descriptors to qemu which is used in restricted environments like libvirt where open() is prohibited. Suggested-by: Eric Blake Signed-off-by: Simon Ruderich Reviewed-by: Eric Blake --- cpus.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[Qemu-devel] [PATCH v3 3/5] cpus: use size_t in qmp_memsave/qmp_pmemsave

2018-05-21 Thread Simon Ruderich
It's the natural type for object sizes and matches the return value of sizeof(buf). Signed-off-by: Simon Ruderich Reviewed-by: Eric Blake --- cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 7fd8d3c32e..49d4d44916 100644 --- a/cpus.c

[Qemu-devel] [PATCH v3 1/5] cpus: correct coding style in qmp_memsave/qmp_pmemsave

2018-05-21 Thread Simon Ruderich
Signed-off-by: Simon Ruderich Reviewed-by: Eric Blake --- cpus.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index d1f16296de..4b1609fe90 100644 --- a/cpus.c +++ b/cpus.c @@ -2316,8 +2316,9 @@ void qmp_memsave(int64_t addr, int64_t size, const char

[Qemu-devel] [PATCH v3 4/5] hmp: don't truncate size in hmp_memsave/hmp_pmemsave

2018-05-21 Thread Simon Ruderich
The called function takes an uint64_t as size parameter and qdict_get_int() returns an uint64_t. Don't truncate it needlessly to an uint32_t. Signed-off-by: Simon Ruderich Reviewed-by: Eric Blake --- hmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmp.c b/

[Qemu-devel] [PATCH v3 0/5] qmp: add pmemload command

2018-05-21 Thread Simon Ruderich
/archive/html/qemu-devel/2018-04/msg01757.html Simon Ruderich (5): cpus: correct coding style in qmp_memsave/qmp_pmemsave cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open cpus: use size_t in qmp_memsave/qmp_pmemsave hmp: don't truncate size in hmp_memsave/hmp_pmemsave qmp: add pm

Re: [Qemu-devel] [PATCH v2 5/5] qmp: add pmemload command

2018-04-24 Thread Simon Ruderich
On Mon, Apr 23, 2018 at 02:46:57PM -0500, Eric Blake wrote: > Back-compat in the QMP interface matters. The HMP interface, however, > exists to serve humans not machines, and we can break it at will to > something that makes more sense to humans. So don't let HMP concerns > hold you back from a s

Re: [Qemu-devel] [PATCH v2 5/5] qmp: add pmemload command

2018-04-22 Thread Simon Ruderich
On Tue, Apr 17, 2018 at 04:18:43PM -0500, Eric Blake wrote: > Focusing on just the interface: > >> +++ b/qapi/misc.json >> @@ -1185,6 +1185,26 @@ >> { 'command': 'pmemsave', >>'data': {'val': 'int', 'size': 'int', 'filename': 'str'} } >> >> +## >> +# @pmemload: >> +# >> +# Load a portion of gu

Re: [Qemu-devel] [PATCH v2 1/5] cpus: correct coding style in qmp_memsave/qmp_pmemsave

2018-04-22 Thread Simon Ruderich
On Tue, Apr 17, 2018 at 03:56:58PM -0500, Eric Blake wrote: > On 04/12/2018 07:50 AM, Simon Ruderich wrote: >> Signed-off-by: Simon Ruderich >> --- >> cpus.c | 6 -- >> 1 file changed, 4 insertions(+), 2 deletions(-) > > Reviewed-by: Eric Blake > > H

[Qemu-devel] [PATCH v2 5/5] qmp: add pmemload command

2018-04-12 Thread Simon Ruderich
stent with the existing pmemsave. Changing the parameter name of pmemsave is not possible without breaking the existing API. [1]: https://lists.gnu.org/archive/html/qemu-trivial/2014-04/msg00074.html Based-on-patch-by: Baojun Wang Signed-off-by: Simon Ruderich --- cpus.c

[Qemu-devel] [PATCH v2 1/5] cpus: correct coding style in qmp_memsave/qmp_pmemsave

2018-04-12 Thread Simon Ruderich
Signed-off-by: Simon Ruderich --- cpus.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 38eba8bff3..c78f430532 100644 --- a/cpus.c +++ b/cpus.c @@ -2263,8 +2263,9 @@ void qmp_memsave(int64_t addr, int64_t size, const char *filename, while

[Qemu-devel] [PATCH v2 4/5] hmp: don't truncate size in hmp_memsave/hmp_pmemsave

2018-04-12 Thread Simon Ruderich
The called function takes an uint64_t as size parameter and qdict_get_int() returns an uint64_t. Don't truncate it needlessly to an uint32_t. Signed-off-by: Simon Ruderich --- hmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmp.c b/hmp.c index a25c7

[Qemu-devel] [PATCH v2 2/5] cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open

2018-04-12 Thread Simon Ruderich
qemu_open() allow passing file descriptors to qemu which is used in restricted environments like libvirt where open() is prohibited. Suggested-by: Eric Blake Signed-off-by: Simon Ruderich --- cpus.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a

[Qemu-devel] [PATCH v2 3/5] cpus: use size_t in qmp_memsave/qmp_pmemsave

2018-04-12 Thread Simon Ruderich
It's the natural type for object sizes and matches the return value of sizeof(buf). Signed-off-by: Simon Ruderich --- cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 292d5b94b1..d256d8e9b4 100644 --- a/cpus.c +++ b/cpus.c @@ -2239,7 +2

Re: [Qemu-devel] [PATCH] qmp: add pmemload command

2018-04-12 Thread Simon Ruderich
On Wed, Apr 11, 2018 at 08:02:58AM -0500, Eric Blake wrote: > You could always add qemu_fopen/qemu_fclose to match the existing > qemu_open/qemu_close. But you do have a point that you can't call > qemu_close/fclose (because fclose would be left with a stale fd that > might spuriously close someth

Re: [Qemu-devel] [PATCH] qmp: add pmemload command

2018-04-11 Thread Simon Ruderich
On Tue, Apr 10, 2018 at 04:33:03PM -0500, Eric Blake wrote: >> +void qmp_pmemload(int64_t addr, int64_t size, const char *filename, >> + Error **errp) >> +{ >> +FILE *f; >> +size_t l; >> +uint8_t buf[1024]; >> + >> +f = fopen(filename, "rb"); > > Use qemu_fopen() he

[Qemu-devel] [PATCH] qmp: add pmemload command

2018-04-10 Thread Simon Ruderich
debug which gdb cannot do directly. pmemload is necessary to directly write physical memory which is not possible with gdb alone as it uses only logical addresses. [1]: https://lists.gnu.org/archive/html/qemu-trivial/2014-04/msg00073.html Based-on-patch-by: Baojun Wang Signed-off-by: Simon