Gonglei 1d45a705fc qdev: Add cleanup logic in device_set_realized() to avoid resource leak
At present, this function doesn't have partial cleanup implemented,
which will cause resource leaks in some scenarios.

Example:

1. Assume that "dc->realize(dev, &local_err)" executes successful
   and local_err == NULL;
2. device hotplug in hotplug_handler_plug() executes but fails
   (it is prone to occur). Then local_err != NULL;
3. error_propagate(errp, local_err) and return. But the resources
   which have been allocated in dc->realize() will be leaked.
Simple backtrace:
  dc->realize()
   |->device_realize
            |->pci_qdev_init()
                |->do_pci_register_device()
                |->etc.

Add fuller cleanup logic which assures that function can
goto appropriate error label as local_err population is
detected at each relevant point.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-09-04 19:15:54 +02:00
2014-08-20 21:15:56 +02:00
2014-06-23 11:00:12 -04:00
2014-09-02 16:07:31 +01:00
2014-08-26 13:52:15 +01:00
2014-09-02 22:38:16 +04:00
2014-08-18 14:39:10 -04:00
2014-08-24 13:16:32 +04:00
2014-08-29 18:40:04 +01:00
2014-09-01 10:19:03 +02:00
2014-06-16 13:24:35 +02:00
2014-08-29 10:46:58 +01:00
2014-08-29 10:46:58 +01:00
2014-08-29 10:46:58 +01:00
2014-06-23 11:12:28 -04:00
2014-08-29 10:46:58 +01:00
2014-07-14 12:03:21 +02:00
2014-09-02 22:38:16 +04:00
2014-06-19 18:44:21 +03:00
2014-06-19 16:41:54 +03:00
2014-08-15 16:37:17 +01:00
2014-08-15 16:37:17 +01:00
2014-06-23 19:09:50 +02:00
2014-08-18 14:39:10 -04:00
2014-08-29 10:48:45 +01:00
2014-09-02 22:38:16 +04:00
2014-08-15 18:44:48 +01:00
2014-08-18 11:59:27 +01:00
2014-09-02 16:07:31 +01:00
2014-08-06 17:53:07 +02:00
2014-08-01 18:30:08 +01:00
2014-09-04 16:14:47 +02:00
2014-07-07 10:37:40 +00:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
Description
No description provided
Readme 404 MiB
Languages
C 82.6%
C++ 6.5%
Python 3.4%
Dylan 2.9%
Shell 1.6%
Other 2.8%