Re: [Qemu-devel] [PATCH 2/3] qdev: Refactor device_set_realized to avoid resource leak

2014-08-19 Thread Gonglei (Arei)
> -Original Message- > From: peter.crosthwa...@petalogix.com > On Tue, Aug 19, 2014 at 7:41 PM, wrote: > > From: Gonglei > > > > At present, the local variable local_err is reused at multi-places, > > Which will cause resource leak in some scenarios. > > > > The problem isn't really the

Re: [Qemu-devel] [PATCH 2/3] qdev: Refactor device_set_realized to avoid resource leak

2014-08-19 Thread Peter Crosthwaite
On Tue, Aug 19, 2014 at 7:41 PM, wrote: > From: Gonglei > > At present, the local variable local_err is reused at multi-places, > Which will cause resource leak in some scenarios. > The problem isn't really the local_err reusage. It's the fact that this function doesn't have partial cleanup imp

[Qemu-devel] [PATCH 2/3] qdev: Refactor device_set_realized to avoid resource leak

2014-08-19 Thread arei.gonglei
From: Gonglei At present, the local variable local_err is reused at multi-places, Which will cause resource leak in some scenarios. Example: 1. Assuming that "dc->realize(dev, &local_err)" execute successful and local_err == NULL; 2. Executing device hotplug in hotplug_handler_plug(), but fa