« Previous | Next » 

Revision 850ec113

ID850ec1133bf0f78ff19402cfd5d77eea376599a9

Added by Markus Armbruster about 13 years ago

blockdev: Fix drive_del not to crash when drive is not in use

Watch this:

(qemu) drive_add 0 if=none,file=tmp.img
OK
(qemu) info block
none0: type=hd removable=0 file=tmp.img ro=0 drv=raw encrypted=0
(qemu) drive_del none0
Segmentation fault (core dumped)

do_drive_del()'s code to clean up the pointer from a qdev using the
drive back to the drive needs to check whether such a device exists.

Signed-off-by: Markus Armbruster <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences