Re: [Qemu-devel] [PATCH] qapi: convert add_client

2012-09-19 Thread Luiz Capitulino
On Wed, 19 Sep 2012 09:08:30 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Tue, 18 Sep 2012 13:13:16 -0600 > > Eric Blake wrote: > > > >> On 09/18/2012 01:06 PM, Luiz Capitulino wrote: > >> > Also fixes a few issues while there: > >> > > >> > 1. The fd returned by monitor

Re: [Qemu-devel] [PATCH] qapi: convert add_client

2012-09-19 Thread Luiz Capitulino
On Wed, 19 Sep 2012 13:04:22 +0200 Paolo Bonzini wrote: > Il 18/09/2012 21:06, Luiz Capitulino ha scritto: > > +fd = monitor_get_fd(cur_mon, fdname); > > +if (fd < 0) { > > +error_setg(errp, "file-description '%s' has not been found", > > fdname); > > +return; > > +}

Re: [Qemu-devel] [PATCH] qapi: convert add_client

2012-09-19 Thread Paolo Bonzini
Il 18/09/2012 21:06, Luiz Capitulino ha scritto: > +fd = monitor_get_fd(cur_mon, fdname); > +if (fd < 0) { > +error_setg(errp, "file-description '%s' has not been found", fdname); > +return; > +} Please change this to add an Error * argument to monitor_get_fd, and chang

Re: [Qemu-devel] [PATCH] qapi: convert add_client

2012-09-19 Thread Markus Armbruster
Luiz Capitulino writes: > On Tue, 18 Sep 2012 13:13:16 -0600 > Eric Blake wrote: > >> On 09/18/2012 01:06 PM, Luiz Capitulino wrote: >> > Also fixes a few issues while there: >> > >> > 1. The fd returned by monitor_get_fd() leaks in most error conditions >> > 2. monitor_get_fd() return value

Re: [Qemu-devel] [PATCH] qapi: convert add_client

2012-09-18 Thread Luiz Capitulino
On Tue, 18 Sep 2012 13:13:16 -0600 Eric Blake wrote: > On 09/18/2012 01:06 PM, Luiz Capitulino wrote: > > Also fixes a few issues while there: > > > > 1. The fd returned by monitor_get_fd() leaks in most error conditions > > 2. monitor_get_fd() return value is not checked. Best case we get > >

Re: [Qemu-devel] [PATCH] qapi: convert add_client

2012-09-18 Thread Eric Blake
On 09/18/2012 01:06 PM, Luiz Capitulino wrote: > Also fixes a few issues while there: > > 1. The fd returned by monitor_get_fd() leaks in most error conditions > 2. monitor_get_fd() return value is not checked. Best case we get > an error that is not correctly reported, worse case one of the