Re: [Qemu-devel] [PATCH 2/2] qdev: safely fail device_add if unable to allocate device

2016-01-12 Thread Daniel P. Berrange
On Mon, Jan 11, 2016 at 05:04:01PM +0100, Andreas Färber wrote: > Am 18.12.2015 um 22:15 schrieb Markus Armbruster: > > Eric Blake writes: > >> On 12/18/2015 09:48 AM, Daniel P. Berrange wrote: > >>> On Fri, Dec 18, 2015 at 04:30:47PM +0100, Igor Mammedov wrote: > qdev_device_add() currently

Re: [Qemu-devel] [PATCH 2/2] qdev: safely fail device_add if unable to allocate device

2016-01-11 Thread Andreas Färber
Am 18.12.2015 um 22:15 schrieb Markus Armbruster: > Eric Blake writes: >> On 12/18/2015 09:48 AM, Daniel P. Berrange wrote: >>> On Fri, Dec 18, 2015 at 04:30:47PM +0100, Igor Mammedov wrote: qdev_device_add() currently uses object_new() which will abort if there memory allocation for dev

Re: [Qemu-devel] [PATCH 2/2] qdev: safely fail device_add if unable to allocate device

2015-12-18 Thread Markus Armbruster
Eric Blake writes: > On 12/18/2015 09:48 AM, Daniel P. Berrange wrote: >> On Fri, Dec 18, 2015 at 04:30:47PM +0100, Igor Mammedov wrote: >>> qdev_device_add() currently uses object_new() which >>> will abort if there memory allocation for device instance >>> fails. While it's fine it startup, it

Re: [Qemu-devel] [PATCH 2/2] qdev: safely fail device_add if unable to allocate device

2015-12-18 Thread Eric Blake
On 12/18/2015 09:48 AM, Daniel P. Berrange wrote: > On Fri, Dec 18, 2015 at 04:30:47PM +0100, Igor Mammedov wrote: >> qdev_device_add() currently uses object_new() which >> will abort if there memory allocation for device instance >> fails. While it's fine it startup, it is not desirable >> diring

Re: [Qemu-devel] [PATCH 2/2] qdev: safely fail device_add if unable to allocate device

2015-12-18 Thread Daniel P. Berrange
On Fri, Dec 18, 2015 at 04:30:47PM +0100, Igor Mammedov wrote: > qdev_device_add() currently uses object_new() which > will abort if there memory allocation for device instance > fails. While it's fine it startup, it is not desirable > diring hotplug. > > Try to allocate memory for object first an

[Qemu-devel] [PATCH 2/2] qdev: safely fail device_add if unable to allocate device

2015-12-18 Thread Igor Mammedov
qdev_device_add() currently uses object_new() which will abort if there memory allocation for device instance fails. While it's fine it startup, it is not desirable diring hotplug. Try to allocate memory for object first and fail safely if allocation fails. Signed-off-by: Igor Mammedov --- It's