Paolo Bonzini b5007bcc97 hmp: do not crash on invalid SCSI hotplug
Commit 0d93692 (qdev: Convert busses to QEMU Object Model, 2012-05-02)
removed a check on the type of the bus where a SCSI disk is hotplugged.
However, hot-plugging to the wrong kind of device now causes a crash
due to either a NULL pointer dereference (avoided by the previous patch)
or a failed QOM cast.

Instead, in this case we need to use object_dynamic_cast and check for
the result, similar to what was done before that commit.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-11-26 09:38:54 -06:00
..
2012-11-01 19:49:45 +01:00
2012-11-01 19:49:45 +01:00
2012-11-14 18:19:22 +01:00
2012-11-26 09:35:35 -06:00
2012-11-10 13:49:20 +00:00
2012-11-12 16:42:56 +01:00
2012-11-10 13:49:20 +00:00
2012-11-26 09:35:35 -06:00
2012-11-26 09:35:35 -06:00
2012-11-26 09:35:37 -06:00
2012-11-16 11:27:05 +01:00
2012-11-05 11:54:49 +01:00
2012-11-26 09:35:36 -06:00
2012-11-10 13:49:20 +00:00
2012-11-10 13:49:20 +00:00
2012-11-16 11:27:07 +01:00
2012-11-16 11:27:06 +01:00