Eduardo Habkost c3481247e5 qmp: object-add: Validate class before creating object
Currently it is very easy to crash QEMU by issuing an object-add command
using an abstract class or a class that doesn't support
TYPE_USER_CREATABLE as parameter.

Example: with the following QMP command:

    (QEMU) object-add qom-type=cpu id=foo

QEMU aborts at:

    ERROR:qom/object.c:335:object_initialize_with_type: assertion failed: (type->abstract == false)

This patch moves the check for TYPE_USER_CREATABLE before object_new(),
and adds a check to prevent the code from trying to instantiate abstract
classes.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-04-25 11:08:34 -04:00
2014-04-23 10:28:14 +02:00
2014-04-25 09:19:59 -04:00
2014-04-25 09:19:58 -04:00
2014-04-25 09:19:58 -04:00
2014-04-25 09:19:59 -04:00
2014-03-19 19:47:15 +01:00
2014-04-07 10:50:30 +02:00
2014-03-27 15:19:00 +05:30
2014-04-18 10:33:36 +04:00
2014-03-27 15:19:00 +05:30
2014-04-22 13:47:46 +02:00
2014-04-22 12:00:20 +02:00
2014-04-22 12:00:20 +02:00
2014-04-18 10:33:36 +04:00
2014-04-23 10:28:14 +02:00
2014-04-17 20:39:32 +01:00
2014-03-27 15:19:00 +05:30

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

- QEMU team
Description
No description provided
Readme 569 MiB
Languages
C 83%
C++ 6.3%
Python 3.2%
Dylan 2.9%
Shell 1.6%
Other 2.8%