Bug 879657 - Monitor command "drive_add 0 if=scsi" crashes
Summary: Monitor command "drive_add 0 if=scsi" crashes
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 18
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2012-11-23 15:26 UTC by Markus Armbruster
Modified: 2013-01-15 00:48 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-01-15 00:48:50 UTC
Type: Bug

Attachments (Terms of Use)

Description Markus Armbruster 2012-11-23 15:26:46 UTC
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Run qemu-system-x86_64 -nodefaults -S -vnc :0 -monitor stdio 
2. Give monitor command drive_add 0 if=scsi

Actual results:
Segmentation fault

Expected results:
Fail command with a suitable error message

Additional info:
F-17 fails the command with "Device is not a SCSI adapter".

Broken upstram in commit 0d936928 "qdev: Convert busses to QEMU Object Model".

Comment 1 Cole Robinson 2012-12-14 22:25:42 UTC
Fixed in 1.2.2 stable by

commit a99cb0d20a4868a31f294f5d1fd4fa3225ea70ab
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:56:18 2012 +0100

    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>
    (cherry picked from commit b5007bcc9729acd995518c52eb1038c4d8416b5d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>

Comment 2 Fedora Update System 2012-12-17 01:27:25 UTC
qemu-1.2.2-1.fc18 has been submitted as an update for Fedora 18.

Comment 3 Fedora Update System 2013-01-11 23:54:53 UTC
qemu-1.2.2-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.