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