Re: [Qemu-devel] [PATCH 2/6] qdev: unref qdev when device_add fails

2013-09-10 Thread Stefan Hajnoczi
On Tue, Sep 10, 2013 at 6:59 PM, Andreas Färber wrote: > Am 10.09.2013 18:49, schrieb Paolo Bonzini: >> Il 10/09/2013 18:21, Stefan Hajnoczi ha scritto: >>> qdev_device_add() leaks the created qdev upon failure. I suspect this >>> problem crept in because qdev_free() unparents the qdev but does n

Re: [Qemu-devel] [PATCH 2/6] qdev: unref qdev when device_add fails

2013-09-10 Thread Paolo Bonzini
Il 10/09/2013 18:59, Andreas Färber ha scritto: > Am 10.09.2013 18:49, schrieb Paolo Bonzini: >> Il 10/09/2013 18:21, Stefan Hajnoczi ha scritto: >>> qdev_device_add() leaks the created qdev upon failure. I suspect this >>> problem crept in because qdev_free() unparents the qdev but does not >>> d

Re: [Qemu-devel] [PATCH 2/6] qdev: unref qdev when device_add fails

2013-09-10 Thread Paolo Bonzini
Il 10/09/2013 18:21, Stefan Hajnoczi ha scritto: > qdev_device_add() leaks the created qdev upon failure. I suspect this > problem crept in because qdev_free() unparents the qdev but does not > drop a reference - confusing name. Right, the name a leftover from pre-refcounting days. BTW, not drop

Re: [Qemu-devel] [PATCH 2/6] qdev: unref qdev when device_add fails

2013-09-10 Thread Andreas Färber
Am 10.09.2013 18:49, schrieb Paolo Bonzini: > Il 10/09/2013 18:21, Stefan Hajnoczi ha scritto: >> qdev_device_add() leaks the created qdev upon failure. I suspect this >> problem crept in because qdev_free() unparents the qdev but does not >> drop a reference - confusing name. > > Right, the name

[Qemu-devel] [PATCH 2/6] qdev: unref qdev when device_add fails

2013-09-10 Thread Stefan Hajnoczi
qdev_device_add() leaks the created qdev upon failure. I suspect this problem crept in because qdev_free() unparents the qdev but does not drop a reference - confusing name. Also drop trailing whitespace after curly bracket. Signed-off-by: Stefan Hajnoczi --- qdev-monitor.c | 4 +++- 1 file ch