From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33840 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oxmu9-00018O-QD for qemu-devel@nongnu.org; Mon, 20 Sep 2010 16:24:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OxmOE-0002JJ-A5 for qemu-devel@nongnu.org; Mon, 20 Sep 2010 15:51:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42218) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxmOE-0002JD-1G for qemu-devel@nongnu.org; Mon, 20 Sep 2010 15:51:02 -0400 Date: Mon, 20 Sep 2010 21:45:03 +0200 From: "Michael S. Tsirkin" Message-ID: <20100920194503.GL30611@redhat.com> References: <20100920180840.GA31179@redhat.com> <20100920192122.GI30611@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PULL] vhost,e1000 fixes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Mon, Sep 20, 2010 at 07:35:36PM +0000, Blue Swirl wrote: > On Mon, Sep 20, 2010 at 7:21 PM, Michael S. Tsirkin wr= ote: > > On Mon, Sep 20, 2010 at 06:23:55PM +0000, Blue Swirl wrote: > >> On Mon, Sep 20, 2010 at 6:08 PM, Michael S. Tsirkin = wrote: > >> > This fixes a bug in vhost error handling > >> > (also triggers build warning with vhost enabled) > >> > and fixes e1000 handling of short frames. > >> > > >> > Discussion on best ways to fix the e1000 issue > >> > is still ongoing but the =A0bug is severe enough > >> > for some guests and the fix is safe enough > >> > that I feel we should have it fixed ASAP > >> > and look for that perfect approach later. > >> > > >> > Both fixes are 0.13 material IMO. > >> > > >> > The following changes since commit 952afb719f3c965bae12b5bd5f0f0f7= ed0251cb8: > >> > > >> > =A0mingw: use ASLR, no-SEH and DEP if available (2010-09-19 08:36:= 34 +0000) > >> > > >> > are available in the git repository at: > >> > =A0git://git.kernel.org/pub/scm/linux/kernel/git/mst/qemu.git for_= anthony > >> > > >> > Michael S. Tsirkin (1): > >> > =A0 =A0 =A0vhost: fix infinite loop on error path > >> > >> I don't think your fix is correct either, it will call the ioctl() > >> with file.index =3D=3D -1. > > > > This is my patch: > > > > - =A0 =A0while (--file.index >=3D 0) { > > + =A0 =A0while (file.index-- > 0) { > > =A0 =A0 =A0 =A0 int r =3D ioctl(net->dev.control, VHOST_NET_SET_BACKE= ND, &file); > > =A0 =A0 =A0 =A0 assert(r >=3D 0); > > =A0 =A0 } > > > > For ioctl to get called with -1, index needs to be 0 > > before the decrement, and while won't be entered ... > > what am I missing? >=20 > Then ioctl() won't be called at all. Is that correct? Yes, this means the first vq SET_BACKEND call failed so nothing needs to be reverted. --=20 MST