From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4nYU-00052x-MK for qemu-devel@nongnu.org; Tue, 16 Jun 2015 05:53:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4nYT-0005KV-JK for qemu-devel@nongnu.org; Tue, 16 Jun 2015 05:53:18 -0400 Date: Tue, 16 Jun 2015 10:53:09 +0100 From: Stefan Hajnoczi Message-ID: <20150616095309.GG22299@stefanha-thinkpad.redhat.com> References: <1434382875-3998-1-git-send-email-berto@igalia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qoTlaiD+Y2fIM3Ll" Content-Disposition: inline In-Reply-To: <1434382875-3998-1-git-send-email-berto@igalia.com> Subject: Re: [Qemu-devel] [PATCH] throttle: Check current timers before updating any_timer_armed[] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org --qoTlaiD+Y2fIM3Ll Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 15, 2015 at 06:41:15PM +0300, Alberto Garcia wrote: > Calling throttle_group_config() cancels all timers from a particular > BlockDriverState, so any_timer_armed[] should be updated accordingly. >=20 > However, with the current code it may happen that a timer is armed in > a different BlockDriverState from the same group, so any_timer_armed[] > would be set to false in a situation where there is still a timer > armed. >=20 > The consequence is that we might end up with two timers armed. This > should not have any noticeable impact however, since all accesses to > the ThrottleGroup are protected by a lock, and the situation would > become normal again shortly thereafter as soon as all timers have been > fired. >=20 > The correct way to solve this is to check that we're actually > cancelling a timer before updating any_timer_armed[]. >=20 > Signed-off-by: Alberto Garcia > --- > block/throttle-groups.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan --qoTlaiD+Y2fIM3Ll Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVf/IFAAoJEJykq7OBq3PIdUkH/j09PlfNIjC8NMGcGi8dvqbe R7JmSiffKujRVz/lBfosx7m6Q4scUOGfZ36Jzr5/PHi4p9JNEeHqGtvXa7bd28j8 JiLyJecLEmLhfimuv5d6c8JDZftuGfY+igqcDkss6s73qa8Ie0+8R+xqaz473dxl 4zCQeqy1n0S13nk/kl8Bs5GHu8HP/4IQ8De3EnehiisG//3tWNN93U0eFlzR6qbW Y1RHFabz/SwUrAuUOppH/UFhT+oQ7k/YP+LqKPqrTfmhPbXE6CA/fIK+zmLkc7XO U4EvNDqw0XlOnyIw55lnJ4z7KEhxkTMLl3aC9xvQCJd+W2vbUvwm+50h2HGi1dE= =ONjS -----END PGP SIGNATURE----- --qoTlaiD+Y2fIM3Ll--