Received: from eggs.gnu.org ([2001:4830:134:3::10]:50193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxjvd-0008Ui-Lb for qemu-devel@nongnu.org; Fri, 21 Oct 2016 20:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxjvc-0006A0-Qz for qemu-devel@nongnu.org; Fri, 21 Oct 2016 20:12:49 -0400 References: <1475237406-26917-1-git-send-email-famz@redhat.com> <1475237406-26917-13-git-send-email-famz@redhat.com> <040d57e9-4135-eb17-48c7-22d5cc773b4f@redhat.com> From: Max Reitz Message-ID: <79d4f8de-8929-26c1-9325-ea396d53ff15@redhat.com> Date: Sat, 22 Oct 2016 02:12:39 +0200 MIME-Version: 1.0 In-Reply-To: <040d57e9-4135-eb17-48c7-22d5cc773b4f@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ndwxheiRhfRxsDWTG14p6AKtSBeMbpthR" Subject: Re: [Qemu-devel] [PATCH v8 12/36] virtio-blk: Apply lock-mode when realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: berrange@redhat.com, John Snow , qemu-block@nongnu.org, Kevin Wolf , rjones@redhat.com, Jeff Cody , Markus Armbruster , stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ndwxheiRhfRxsDWTG14p6AKtSBeMbpthR From: Max Reitz To: Fam Zheng , qemu-devel@nongnu.org Cc: berrange@redhat.com, John Snow , qemu-block@nongnu.org, Kevin Wolf , rjones@redhat.com, Jeff Cody , Markus Armbruster , stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com Message-ID: <79d4f8de-8929-26c1-9325-ea396d53ff15@redhat.com> Subject: Re: [PATCH v8 12/36] virtio-blk: Apply lock-mode when realize References: <1475237406-26917-1-git-send-email-famz@redhat.com> <1475237406-26917-13-git-send-email-famz@redhat.com> <040d57e9-4135-eb17-48c7-22d5cc773b4f@redhat.com> In-Reply-To: <040d57e9-4135-eb17-48c7-22d5cc773b4f@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 22.10.2016 02:08, Max Reitz wrote: > On 30.09.2016 14:09, Fam Zheng wrote: >> Signed-off-by: Fam Zheng >> --- >> hw/block/virtio-blk.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c >> index 3a6112f..ce65615 100644 >> --- a/hw/block/virtio-blk.c >> +++ b/hw/block/virtio-blk.c >> @@ -896,6 +896,11 @@ static void virtio_blk_device_realize(DeviceState= *dev, Error **errp) >> error_setg(errp, "num-queues property must be larger than 0")= ; >> return; >> } >> + blk_lock_image(conf->conf.blk, conf->conf.lock_mode, &err); >> + if (err) { >> + error_propagate(errp, err); >> + return; >> + } >> =20 >> blkconf_serial(&conf->conf, &conf->serial); >> blkconf_apply_backend_options(&conf->conf); >> >=20 > Hmmm... Patch 3 introduced the conf.lock_mode field, but didn't do > anything with it. That is a bit weird. Now you're applying it here but > can't set it anywhere. That's a bit weird, too. Well, behavior won't > change as this probably just means that now everything explicitly > unlocked instead of implicitly "because we don't have locking yet". >=20 > Maybe it would make sense to move the introduction of conf.lock_mode to= > an own patch and explain in the commit message that this field will be > implicitly set to 0, so until the user is able to control the field, > every BB (and thus BDS tree) will not be locked (thus not changing > behavior). Oops, just noticed that it won't be "unlocked" but "auto-locked" (all the more reason to mention the implicit behavior somewhere). But maybe my comment for patch 15 has obsoleted this comment altogether. Max --ndwxheiRhfRxsDWTG14p6AKtSBeMbpthR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJYCq73EhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQB+m CACObkfmU4fP1oZ/dNOECHN9yfxsJOywm63yYDyhvzugcnL//7HIuCFZSragO7jw 4/i+XdxmfhuyiK90yrXLK1RNWpYbZxyBhaOmsInDp2l7thKZI0AbJa+O7uzJz8ED qR0q/pTw1wwcywOP7b5jd1UGu/n8552MJRGda4cSSIY+l6y/Oyq9JoUPTiqQFNYv 19cr9TOQZwc6aUkJUBM6frfUt6xu9RJKsZ5TjYr00FADxJzh8fl518HX8OB//hNF c3sPyDQ0UkJI7zLwUdwo/HgVCYHJk0i9Pcx/GG64boePEfplwDp2j89sJU8b/Kkq UFQ1bZVD2V/SQg7gbI3vRU+U =ztzt -----END PGP SIGNATURE----- --ndwxheiRhfRxsDWTG14p6AKtSBeMbpthR--