Eduardo Habkost 3b5276b5ec monitor: allow device to be ejected if no disk is inserted
This changes the monitor eject_device() function to not check for
bdrv_is_inserted().

Example run where the bug manifests itself:

(output of 'info block' is stripped to include only the CD-ROM device)

  (qemu) info block
  ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]
  (qemu) change ide1-cd0 /dev/cdrom host_cdrom
  (qemu) info block
  ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_cdrom encrypted=0
  (qemu) eject ide1-cd0
  (qemu) info block
  ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_cdrom encrypted=0

  # at this point, a disk was inserted on the host CD-ROM drive

  (qemu) info block
  ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_cdrom encrypted=0
  (qemu) eject ide1-cd0
  (qemu) info block
  ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]
  (qemu)

The first eject command didn't work because the is_inserted() check
failed.

I have no clue why the code had the is_inserted() check, as it doesn't matter
if there is a disk present at the host drive, when the user wants the virtual
device to be disconnected from the host device.

The is_inserted() check has another side effect: a memory leak if the "change"
command is used multiple times, as do_change() calls eject_device() before
re-opening the block device, but bdrv_close() is never called.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-22 14:38:01 +02:00
2010-05-22 08:02:12 +00:00
2010-06-15 09:41:59 +02:00
2010-06-10 00:09:49 +02:00
2010-05-22 08:00:52 +00:00
2010-01-13 17:14:16 -06:00
2010-06-16 13:03:51 +01:00
2010-06-20 07:55:12 +00:00
2010-05-14 10:55:58 -05:00
2010-06-11 20:37:51 +01:00
2010-06-16 13:46:15 +02:00
2010-06-19 07:47:42 +00:00
2010-06-09 23:37:36 +02:00
2010-05-07 16:28:10 +00:00
2010-05-20 21:04:47 +02:00
2010-03-06 23:09:28 +01:00
2008-12-13 09:32:43 +00:00
2009-09-12 07:36:22 +00:00
2009-09-12 07:36:22 +00:00
2009-05-13 20:54:26 +01:00
2004-08-01 21:54:53 +00:00
2009-09-25 19:53:21 +00:00
2010-06-14 11:12:53 -05:00
2010-06-16 13:03:51 +01:00
2010-04-09 18:55:56 +02:00
2010-04-09 18:55:56 +02:00
2010-06-15 09:41:59 +02:00
2010-05-31 20:55:23 +02:00
2009-03-10 21:43:35 +00:00
2010-02-07 02:03:50 +03:00
2009-01-14 18:39:49 +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-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2008-10-12 17:54:42 +00:00
2010-06-14 11:12:53 -05:00
2010-04-25 12:59:33 +00:00
2010-03-21 19:44:06 +00:00
2010-05-24 15:18:23 -05:00
2010-03-17 11:16:15 -05:00
2008-10-27 19:49:12 +00:00
2010-04-01 21:51:59 +02:00
2010-04-01 21:51:59 +02:00
2010-03-01 04:39:50 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2010-06-13 19:00:50 +01:00
2010-05-19 15:24:17 +02:00
2009-09-12 07:36:22 +00:00
2010-06-14 11:12:53 -05:00
2010-06-16 13:03:51 +01:00
2010-06-16 13:03:51 +01:00
2010-03-29 19:24:00 +00:00
2009-12-17 18:12:04 +01:00
2007-09-16 20:03:23 +00:00
2010-05-22 08:02:12 +00:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05:00
2009-10-01 16:12:16 -05: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
2009-11-17 08:49:39 -06:00
2009-11-17 08:49:39 -06:00
2010-03-06 23:15:30 +01:00
2010-03-06 23:15:30 +01:00
2010-06-13 19:00:50 +01:00
2008-12-14 08:50:18 +00:00
2010-06-16 13:03:51 +01:00
2010-02-06 19:24:42 +01:00
2010-03-21 08:28:47 +00:00
2010-05-22 08:24:49 +00:00
2010-01-08 09:58:40 -06:00
2010-03-19 15:27:27 -05:00
2009-09-12 07:36:22 +00:00
2010-05-03 12:39:12 -05:00
2010-05-22 08:02:12 +00:00
2010-06-13 19:00:50 +01:00
2010-06-13 19:00:50 +01:00
2009-12-03 09:41:29 -06:00
2009-12-25 18:19:15 +00:00
2010-05-19 12:45:54 -03:00
2009-11-17 08:49:39 -06:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2009-10-27 12:28:59 -05:00
2010-06-19 07:47:42 +00:00
2010-05-29 02:27:35 +01:00
2010-06-04 11:43:39 +02:00
2009-10-01 16:12:16 -05:00
2010-06-15 09:41:59 +02:00
2010-05-17 10:20:04 +02:00
2010-05-19 12:45:54 -03:00
2010-03-29 19:24:00 +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
2009-11-17 08:49:38 -06:00
2010-05-19 12:45:54 -03:00
2010-05-19 12:45:54 -03:00
2010-06-11 15:25:14 -03:00
2009-12-03 09:41:18 -06: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
2008-12-14 08:50:18 +00:00
2010-06-15 09:41:59 +02:00
2009-10-01 16:12:16 -05:00
2009-06-29 08:52:44 -05:00
2009-07-08 18:25:37 +04:00
2009-09-13 19:38:43 +00:00
2010-06-14 15:46:28 -05:00
2010-03-14 22:04:50 +01:00
2008-12-04 11:29:42 +00:00
2009-10-01 16:12:16 -05:00
2009-03-05 23:01:23 +00:00
2008-09-06 16:31:30 +00:00
2010-06-14 15:46:28 -05:00
2009-10-01 16:12:16 -05:00
2009-03-06 23:44:29 +00:00
2009-03-06 23:44:29 +00:00
2010-06-13 19:00:50 +01:00
2009-03-06 23:44:29 +00:00
2010-06-01 13:30:08 -05:00
2010-05-24 15:18:24 -05:00

Read the documentation in qemu-doc.html.

Fabrice Bellard.
Description
A fork of QEMU-Nyx which is better suited for my bachelors thesis
Readme 154 MiB
Languages
C 90.3%
Dylan 2.5%
Python 2.1%
C++ 2%
Shell 1.7%
Other 1.4%