From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmNkl-0002LX-GK for qemu-devel@nongnu.org; Wed, 14 Oct 2015 11:14:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmNkk-0004ce-KT for qemu-devel@nongnu.org; Wed, 14 Oct 2015 11:14:07 -0400 References: <1444680042-13207-1-git-send-email-mreitz@redhat.com> <1444680042-13207-25-git-send-email-mreitz@redhat.com> <20151014132705.GB16803@noname.str.redhat.com> From: Max Reitz Message-ID: <561E7134.7050601@redhat.com> Date: Wed, 14 Oct 2015 17:13:56 +0200 MIME-Version: 1.0 In-Reply-To: <20151014132705.GB16803@noname.str.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7MI7miBrkF8RlOwpVLxF9bqwaQaXuW9Db" Subject: Re: [Qemu-devel] [PATCH v6 24/39] blockdev: Do not create BDS for empty drive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Alberto Garcia , qemu-block@nongnu.org, John Snow , qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7MI7miBrkF8RlOwpVLxF9bqwaQaXuW9Db Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 14.10.2015 15:27, Kevin Wolf wrote: > Am 12.10.2015 um 22:00 hat Max Reitz geschrieben: >> Do not use "rudimentary" BDSs for empty drives any longer (for >> freshly created drives). >> >> After a follow-up patch, empty drives will generally use a NULL BDS, n= ot >> only the freshly created drives. >> >> Signed-off-by: Max Reitz >> --- >> blockdev.c | 72 ++++++++++++++++++++++++++++++++++++++---------------= --------- >> 1 file changed, 44 insertions(+), 28 deletions(-) >> >> diff --git a/blockdev.c b/blockdev.c >> index 35efe84..845a1c1 100644 >> --- a/blockdev.c >> +++ b/blockdev.c >> @@ -514,16 +514,44 @@ static BlockBackend *blockdev_init(const char *f= ile, QDict *bs_opts, >> goto early_err; >> } >> =20 >> + if (snapshot) { >> + /* always use cache=3Dunsafe with snapshot */ >> + bdrv_flags &=3D ~BDRV_O_CACHE_MASK; >> + bdrv_flags |=3D (BDRV_O_SNAPSHOT|BDRV_O_CACHE_WB|BDRV_O_NO_FL= USH); >> + } >> + >> + if (copy_on_read) { >> + bdrv_flags |=3D BDRV_O_COPY_ON_READ; >> + } >> + >> + if (runstate_check(RUN_STATE_INMIGRATE)) { >> + bdrv_flags |=3D BDRV_O_INCOMING; >> + } >=20 > Bad conflict resolution when you added patch 2, which moved the > BDRV_O_INCOMING code to block.c? Oops, indeed. I was wondering why I only removed it once from blockdev_init(). Thanks. > That patch is actually essential here as well: The flag would ends up i= n > the root state, and bdrv_invalidate_cache_all() doesn't clear the flag > any more. So we might end up opening an image with BDRV_O_INCOMING even= > though migration has long finished. Yep. Will fix. Max --7MI7miBrkF8RlOwpVLxF9bqwaQaXuW9Db Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWHnE0AAoJEDuxQgLoOKytgTgH/RlNs2zSl4eAQuCnSrs8zvLY aUKEYM2C+IcGf+Zi7eozqyYRCUOpUs4HdziZ/v5Ca1laupMI/VO7d0zEWqBVljqs D+T3xBwZwc9GnT4V35NnBGlayOSOt+55kdqJGchiqbFNYKT9H9hRuo+UH9c224JA joedudRVBWlIfxuS2L7gnJXz/4Txnd/v/QD91G1YivvOXHrqnqc8qgWRSfAKQ3De IeNb3rots7AXu8qcjoRx/xxCRM+7u/pjSvAPRqhltUH3TPgiBT/zwFa0741Fmyg0 NbNNRIPcc4Wjgs4TltzDlWcjI9LLw1tA58U0vQCZVbX/I6I+Ix6jMJJDEnGDmhA= =2He5 -----END PGP SIGNATURE----- --7MI7miBrkF8RlOwpVLxF9bqwaQaXuW9Db--