Received: from eggs.gnu.org ([2001:4830:134:3::10]:49823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxjrv-0006pi-DA for qemu-devel@nongnu.org; Fri, 21 Oct 2016 20:09:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxjru-0004xW-I4 for qemu-devel@nongnu.org; Fri, 21 Oct 2016 20:08:59 -0400 References: <1475237406-26917-1-git-send-email-famz@redhat.com> <1475237406-26917-13-git-send-email-famz@redhat.com> From: Max Reitz Message-ID: <040d57e9-4135-eb17-48c7-22d5cc773b4f@redhat.com> Date: Sat, 22 Oct 2016 02:08:48 +0200 MIME-Version: 1.0 In-Reply-To: <1475237406-26917-13-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LVeD9PMoFOJMWHVGw2Frn7365vTRl2QFi" 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) --LVeD9PMoFOJMWHVGw2Frn7365vTRl2QFi 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: <040d57e9-4135-eb17-48c7-22d5cc773b4f@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> In-Reply-To: <1475237406-26917-13-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable 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(+) >=20 > 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". 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). Max --LVeD9PMoFOJMWHVGw2Frn7365vTRl2QFi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJYCq4QEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQOTf B/9bAyFy9/rzG5o9ClLxZvKFi/LjhoFWIELsfbTWXOt4ZYdWJ6fuQWpvNKJo8Fxt qkQqTpb8hgL54WzckVOHK0m4NfSOQht5/Z/6npuM0YvzhI+phicvknPqmtWyVuLW MSBGOm3FpIfwyxbhfGxd/VQe9axt3WNcrY123DWGmVZpYPksQXw3RKPYU3TEk4VI eUCxWM6m3fl5s88XVIzF0PRdaAI/QnbqLfU+budLo/hbZBoJXfKWXyFThGrMjVWE 4zuUyoYRwFkZHMzEjtwXHp0TPgEC2cLd7NFFAEo+YF5G6t8QBhtHKOuqXmOHH7g9 vlWX3Lv2C4U6pCKXMKNq4Mcg =4CrY -----END PGP SIGNATURE----- --LVeD9PMoFOJMWHVGw2Frn7365vTRl2QFi--