Markus Armbruster 319ae529b8 blockdev: Fix drive_add for drives without media
Watch this:

    (qemu) drive_add 0 if=none
    (qemu) info block
    none0: type=hd removable=0 [not inserted]
    (qemu) drive_del none0
    Segmentation fault (core dumped)

add_init_drive() is confused about drive_init()'s failure modes, and
cleans up when it shouldn't.  This leaves the DriveInfo with member
opts dangling.  drive_del attempts to free it, and dies.

drive_init() behaves as follows:

* If it created a drive with media, it returns its DriveInfo.

* If it created a drive without media, it clears *fatal_error and
  returns NULL.

* If it couldn't create a drive, it sets *fatal_error and returns
  NULL.

Of its three callers:

* drive_init_func() is correct.

* usb_msd_init() assumes drive_init() failed when it returns NULL.
  This is correct only because it always passes option "file", and
  "drive without media" can't happen then.

* add_init_drive() assumes drive_init() failed when it returns NULL.
  This is incorrect.

Clean up drive_init() to return NULL on failure and only on failure.
Drop its parameter fatal_error.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-31 11:59:24 +01:00
2011-01-25 19:56:53 +03:00
2011-01-29 22:52:00 +00:00
2011-01-30 13:10:10 +00:00
2010-12-09 14:23:24 +01:00
2011-01-29 22:52:00 +00:00
2011-01-21 23:12:42 +01:00
2011-01-29 22:52:33 +00:00
2010-03-06 23:09:28 +01:00
2011-01-25 09:18:00 +01:00
2011-01-25 09:18:00 +01:00
2010-04-09 18:55:56 +02:00
2011-01-10 10:55:10 +01:00
2010-12-02 21:13:39 +02:00
2010-11-01 00:54:06 +03:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2011-01-20 20:58:56 +00:00
2010-10-20 16:15:04 -05:00
2010-10-20 16:15:04 -05:00
2011-01-29 22:52:00 +00:00
2011-01-04 21:58:24 +01:00
2010-05-24 15:18:23 -05:00
2011-01-16 08:32:27 +00:00
2011-01-20 20:54:21 +00:00
2010-03-29 19:24:00 +00:00
2010-05-22 08:02:12 +00:00
2010-11-21 09:16:57 -06:00
2010-11-21 09:16:57 -06:00
2010-11-21 09:16:57 -06:00
2010-05-10 11:36:03 -05:00
2010-05-10 11:36:03 -05:00
2010-06-11 15:25:14 -03:00
2011-01-20 20:54:21 +00:00
2010-03-21 08:28:47 +00:00
2010-05-22 08:24:49 +00:00
2011-01-24 11:08:51 +01:00
2011-01-24 20:54:34 +00:00
2011-01-17 18:22:17 +02:00
2010-12-09 14:23:24 +01:00
2010-10-30 08:02:40 +00:00
2010-05-19 12:45:54 -03:00
2010-07-01 14:27:13 -03:00
2010-07-01 14:27:13 -03:00
2010-09-22 20:05:23 +00:00
2010-11-17 09:52:24 -02:00
2010-11-17 09:52:24 -02:00
2010-12-11 21:32:47 +00:00
2010-09-21 18:36:42 +02:00
2011-01-20 20:54:21 +00:00
2011-01-31 10:03:00 +01:00
2010-05-19 12:45:54 -03:00
2011-01-09 20:59:53 +00:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-10-01 10:12:43 -03:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-09-18 05:53:14 +00:00
2011-01-20 20:54:21 +00:00
2011-01-25 09:18:00 +01:00
2010-03-14 22:04:50 +01:00
2011-01-24 20:54:34 +00:00
2011-01-09 14:43:33 +00:00
2010-07-28 07:58:15 -05:00

Read the documentation in qemu-doc.html.

Fabrice Bellard.
Description
Original Xbox Emulator for Windows, macOS, and Linux (Active Development)
Readme 531 MiB
Languages
C 82.5%
C++ 7%
Python 3.3%
Dylan 2.8%
Shell 1.5%
Other 2.6%