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

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

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

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. > >

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: >

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

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

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: > > > >