diff options
author | Andreas Färber <afaerber@suse.de> | 2012-02-17 02:47:44 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-17 09:58:21 -0600 |
commit | 4ed658ca925249021789d6a51fd6f99f68213f28 (patch) | |
tree | 44158198e9a6ed5dcc15a36fc984ef3c5f35534b /cutils.c | |
parent | 438e1c79f196f0bc9411ef8183f9906e0efbd578 (diff) |
qdev: Fix qdev_try_create() semantics
Since QOM'ification, qdev_try_create() uses object_new() internally,
which asserts "type != NULL" when the type is not registered.
This was revealed by the combination of kvmclock's kvm_enabled() check
and early QOM type registration.
Check whether the class exists before calling object_new(), so that
the caller (e.g., qdev_create) can fail gracefully, telling us which
device could not be created.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <aliguori@codemonkey.ws>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'cutils.c')
0 files changed, 0 insertions, 0 deletions