Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 11:36:41AM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 10:47, Peter Xu wrote: > > So from what I understand from your reply, I could include the > > percentage value into "query-dump", right? :) > > If you have the written and total bytes in the QMP reply, you can use

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Paolo Bonzini
On 30/11/2015 10:47, Peter Xu wrote: > So from what I understand from your reply, I could include the > percentage value into "query-dump", right? :) If you have the written and total bytes in the QMP reply, you can use total*100/written to compute the percentage in the HMP return value. If tot

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 10:28:08AM +0100, Markus Armbruster wrote: > Paolo Bonzini writes: > > > On 30/11/2015 04:47, Peter Xu wrote: > >> > >> I met one problem when trying to add a new public function in dump.h > >> named "dump_state_get_global" and using it in hmp.c. > > > > Don't do that. :)

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 10:12:10AM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 04:47, Peter Xu wrote: > > > > I met one problem when trying to add a new public function in dump.h > > named "dump_state_get_global" and using it in hmp.c. > > Don't do that. :) > > hmp.c functions should in ge

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Markus Armbruster
Paolo Bonzini writes: > On 30/11/2015 04:47, Peter Xu wrote: >> >> I met one problem when trying to add a new public function in dump.h >> named "dump_state_get_global" and using it in hmp.c. > > Don't do that. :) > > hmp.c functions should in general use the QMP commands as the base. In > your

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Paolo Bonzini
On 30/11/2015 04:47, Peter Xu wrote: > > I met one problem when trying to add a new public function in dump.h > named "dump_state_get_global" and using it in hmp.c. Don't do that. :) hmp.c functions should in general use the QMP commands as the base. In your case, hmp_info_dump should call qm

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 09:06:45AM +0100, Markus Armbruster wrote: > Peter Xu writes: > > > Hi, all, > > > > I met one problem when trying to add a new public function in dump.h > > named "dump_state_get_global" and using it in hmp.c. What I got is > > something like: > > > > In file included fro

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Markus Armbruster
Peter Xu writes: > Hi, all, > > I met one problem when trying to add a new public function in dump.h > named "dump_state_get_global" and using it in hmp.c. What I got is > something like: > > In file included from /root/git/qemu/hmp.c:35:0: > /root/git/qemu/include/sysemu/dump.h:26:34: error: att

[Qemu-devel] question: about exec/poison.h

2015-11-29 Thread Peter Xu
Hi, all, I met one problem when trying to add a new public function in dump.h named "dump_state_get_global" and using it in hmp.c. What I got is something like: In file included from /root/git/qemu/hmp.c:35:0: /root/git/qemu/include/sysemu/dump.h:26:34: error: attempt to use poisoned "TARGET_PAG