On Wed 20 Jan 2016 07:29:19 PM CET, Max Reitz wrote: > @@ -2424,6 +2442,15 @@ static void qmp_blockdev_insert_anon_medium(const char > *device, > > blk_insert_bs(blk, bs); > > + if (!blk_dev_has_tray(blk)) { > + /* For tray-less devices, blockdev-close-tray is a no-op (or may not > be > + * called at all); therefore, the medium needs to be pushed into the > + * slot here. > + * Do it after blk_insert_bs() so blk_is_inserted(blk) returns the > @load > + * value passed here (i.e. true). */ > + blk_dev_change_media_cb(blk, true); > + } > + > QTAILQ_INSERT_TAIL(&bdrv_states, bs, device_list); > }
Any reason why you do this before updating bdrv_states ? If the device has a tray this would happen afterwards, in qmp_blockdev_close_tray(). Berto