Received: from eggs.gnu.org ([2001:4830:134:3::10]:50194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMYU6-0007QR-4d for qemu-devel@nongnu.org; Fri, 22 Jan 2016 04:58:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMYU5-0007Qk-CI for qemu-devel@nongnu.org; Fri, 22 Jan 2016 04:58:26 -0500 From: Alberto Garcia In-Reply-To: <1453314561-10486-3-git-send-email-mreitz@redhat.com> References: <1453314561-10486-1-git-send-email-mreitz@redhat.com> <1453314561-10486-3-git-send-email-mreitz@redhat.com> Date: Fri, 22 Jan 2016 10:58:19 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v2 2/4] blockdev: Fix 'change' for slot devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , Peter Maydell , qemu-stable , qemu-devel@nongnu.org, John Snow , Markus Armbruster 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