Received: from eggs.gnu.org ([2001:4830:134:3::10]:37359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZU8GT-0005At-6n for qemu-devel@nongnu.org; Tue, 25 Aug 2015 03:03:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZU8GP-0007zj-4S for qemu-devel@nongnu.org; Tue, 25 Aug 2015 03:03:25 -0400 From: Alberto Garcia In-Reply-To: <55DB6880.1050100@redhat.com> References: <1440421537-26477-1-git-send-email-berto@igalia.com> <55DB6880.1050100@redhat.com> Date: Tue, 25 Aug 2015 09:03:15 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] block: Override the driver in the filename with the user-specified one List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org On Mon 24 Aug 2015 08:54:56 PM CEST, Max Reitz wrote: [bdrv_fill_options()] > User-specified options should always have precedence over any other > option. The thing is, we consider the filename to be specified by the > user. For user-specified options like the "lazy-refcounts" case that I mentioned it makes sense, because that's the way the user wants to open it. For the image format it sounds counter-intuitive to me: the format is already set when the file is opened, the user doesn't have a choice there, or does she? > So it is actually correct that this option overrides the @drv > parameter given to bdrv_open(), because that cannot be set by the user > and is always set by qemu internally. Is that really the case? The drv parameter of bdrv_open() is being set by the user in a number of places: qmp_drive_backup(), qmp_drive_mirror(), qmp_change_blockdev() and qemu-img create. > So I think the problem here is not in bdrv_fill_options(), but rather > in blockdev.c:external_snapshot_prepare(). This function should not > pass the driver as the @drv parameter to bdrv_open(), but rather set > the "driver" option in @options in order to mark this a user-specified > option. I guess in that case we should change that in all the other places I mentioned above. Berto