Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-11 Thread Balamuruhan S
On 8/9/19 2:16 PM, Stefan Hajnoczi wrote: > On Thu, Aug 08, 2019 at 11:53:07AM +0100, Daniel P. Berrangé wrote: >> On Thu, Aug 08, 2019 at 11:10:13AM +0100, Stefan Hajnoczi wrote: >>> On Wed, Aug 07, 2019 at 12:20:47PM +0200, Philippe Mathieu-Daudé wrote: > +void python_args_clean(char *args

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-11 Thread Balamuruhan S
On 8/8/19 6:15 PM, Philippe Mathieu-Daudé wrote: > On 8/8/19 12:49 PM, Daniel P. Berrangé wrote: >> On Wed, Aug 07, 2019 at 12:44:40PM +0530, Balamuruhan S wrote: >>> Adds scripting interface with python library to call functions in >>> python modules from Qemu that can be used to feed input extern

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-10 Thread Balamuruhan S
On 8/8/19 3:39 PM, Stefan Hajnoczi wrote: > On Wed, Aug 07, 2019 at 12:44:40PM +0530, Balamuruhan S wrote: >> +void python_args_init_cast_int(char *args[], int arg, int pos) >> +{ >> +args[pos]= malloc(sizeof(int)); >> +sprintf(args[pos], "%d", arg); >> +} > This is broken. args[pos] is

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-09 Thread Stefan Hajnoczi
On Thu, Aug 08, 2019 at 11:53:07AM +0100, Daniel P. Berrangé wrote: > On Thu, Aug 08, 2019 at 11:10:13AM +0100, Stefan Hajnoczi wrote: > > On Wed, Aug 07, 2019 at 12:20:47PM +0200, Philippe Mathieu-Daudé wrote: > > > > +void python_args_clean(char *args[], int nargs) > > > > +{ > > > > +for (in

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-08 Thread David Gibson
On Thu, Aug 08, 2019 at 02:45:02PM +0200, Philippe Mathieu-Daudé wrote: > On 8/8/19 12:49 PM, Daniel P. Berrangé wrote: > > On Wed, Aug 07, 2019 at 12:44:40PM +0530, Balamuruhan S wrote: > >> Adds scripting interface with python library to call functions in > >> python modules from Qemu that can be

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-08 Thread Philippe Mathieu-Daudé
On 8/8/19 12:49 PM, Daniel P. Berrangé wrote: > On Wed, Aug 07, 2019 at 12:44:40PM +0530, Balamuruhan S wrote: >> Adds scripting interface with python library to call functions in >> python modules from Qemu that can be used to feed input externally >> and without recompiling Qemu that can be used

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-08 Thread Daniel P . Berrangé
On Thu, Aug 08, 2019 at 11:10:13AM +0100, Stefan Hajnoczi wrote: > On Wed, Aug 07, 2019 at 12:20:47PM +0200, Philippe Mathieu-Daudé wrote: > > > +void python_args_clean(char *args[], int nargs) > > > +{ > > > +for (int i = 0; i < nargs; i++) { > > > +g_free(args[i]); > > > +} > > >

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-08 Thread Daniel P . Berrangé
On Wed, Aug 07, 2019 at 12:44:40PM +0530, Balamuruhan S wrote: > Adds scripting interface with python library to call functions in > python modules from Qemu that can be used to feed input externally > and without recompiling Qemu that can be used for early development, > testing and can be extende

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-08 Thread Philippe Mathieu-Daudé
On 8/8/19 12:10 PM, Stefan Hajnoczi wrote: > On Wed, Aug 07, 2019 at 12:20:47PM +0200, Philippe Mathieu-Daudé wrote: >>> +void python_args_clean(char *args[], int nargs) >>> +{ >>> +for (int i = 0; i < nargs; i++) { >>> +g_free(args[i]); >>> +} >>> +} >>> >> >> Wondering about secur

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-08 Thread Stefan Hajnoczi
On Wed, Aug 07, 2019 at 12:20:47PM +0200, Philippe Mathieu-Daudé wrote: > > +void python_args_clean(char *args[], int nargs) > > +{ > > +for (int i = 0; i < nargs; i++) { > > +g_free(args[i]); > > +} > > +} > > > > Wondering about security, is this feature safe to enable in produc

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-08 Thread Stefan Hajnoczi
On Wed, Aug 07, 2019 at 12:44:40PM +0530, Balamuruhan S wrote: > +void python_args_init_cast_int(char *args[], int arg, int pos) > +{ > +args[pos]= malloc(sizeof(int)); > +sprintf(args[pos], "%d", arg); > +} This is broken. args[pos] is a (possibly NULL) pointer to 4 bytes. sprintf() will

Re: [Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-07 Thread Philippe Mathieu-Daudé
Hi, On 8/7/19 9:14 AM, Balamuruhan S wrote: > Adds scripting interface with python library to call functions in > python modules from Qemu that can be used to feed input externally > and without recompiling Qemu that can be used for early development, > testing and can be extended to abstract some

[Qemu-devel] [RFC PATCH 1/6] utils/python_api: add scripting interface for Qemu with python lib

2019-08-07 Thread Balamuruhan S
Adds scripting interface with python library to call functions in python modules from Qemu that can be used to feed input externally and without recompiling Qemu that can be used for early development, testing and can be extended to abstract some of Qemu code out to a python script to ease maintena