[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH v2 2/4] blockdev: Fix 'change' for slot devices
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-stable] [PATCH v2 2/4] blockdev: Fix 'change' for slot devices |
Date: |
Fri, 22 Jan 2016 10:58:19 +0100 |
User-agent: |
Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) |
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