From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkVe0-00035O-PH for qemu-devel@nongnu.org; Thu, 15 Sep 2016 08:19:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkVdv-0005j1-P2 for qemu-devel@nongnu.org; Thu, 15 Sep 2016 08:19:56 -0400 Date: Thu, 15 Sep 2016 14:19:36 +0200 From: Kevin Wolf Message-ID: <20160915121936.GE4726@noname.redhat.com> References: <5fd02facca962ec5c64ef45a43413d4c5571d42c.1473867966.git.berto@igalia.com> <20160914164029.GH4649@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 2/7] block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz Am 15.09.2016 um 13:24 hat Alberto Garcia geschrieben: > On Wed 14 Sep 2016 06:40:29 PM CEST, Kevin Wolf wrote: > >> + if (flags & BDRV_O_RDWR) { > >> + flags |= BDRV_O_ALLOW_RDWR; > >> + } > >> + > >> + if (flags & BDRV_O_SNAPSHOT) { > >> + snapshot_options = qdict_new(); > >> + bdrv_temp_snapshot_options(&snapshot_flags, snapshot_options, > >> + flags, options); > >> + bdrv_backing_options(&flags, options, flags, options); > >> + } > >> + > >> bs->open_flags = flags; > >> bs->options = options; > >> options = qdict_clone_shallow(options); > > > > Here I think we get different semantics now: bdrv_backing_options() > > only affected the cloned QDict before, and now it affects bs->options, > > too. > > The thing is that bdrv_backing_options() doesn't change the options in > general, and in the case where it does (BDRV_OPT_READ_ONLY after the > next patch) I think it makes sense that the options are changed. > "snapshot=on" is a bit of a special case after all. Fair enough, it is correct (as I suspected), but it's not a bug fix because so far the options weren't changed, so there's no observable difference. I think mentioning this in the commit message wouldn't hurt, though. Kevin