Received: from eggs.gnu.org ([2001:4830:134:3::10]:53570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn4Nv-0000lE-1E for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:49:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn4Nq-0001lb-0r for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:49:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53777 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn4Np-0001lS-Qn for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:49:49 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8MDmOvn132216 for ; Thu, 22 Sep 2016 09:49:49 -0400 Received: from e06smtp09.uk.ibm.com (e06smtp09.uk.ibm.com [195.75.94.105]) by mx0a-001b2d01.pphosted.com with ESMTP id 25mcanfkur-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 22 Sep 2016 09:49:49 -0400 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Sep 2016 14:49:47 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5E26A219004D for ; Thu, 22 Sep 2016 14:49:05 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8MDnj4I14025098 for ; Thu, 22 Sep 2016 13:49:45 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8MDnj3H032650 for ; Thu, 22 Sep 2016 07:49:45 -0600 Date: Thu, 22 Sep 2016 15:49:43 +0200 From: Cornelia Huck In-Reply-To: <1474473146-19337-5-git-send-email-stefanha@redhat.com> References: <1474473146-19337-1-git-send-email-stefanha@redhat.com> <1474473146-19337-5-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160922154943.4fbabf4a.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH v5 4/9] virtio: handle virtqueue_map_desc() errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Fam Zheng On Wed, 21 Sep 2016 16:52:21 +0100 Stefan Hajnoczi wrote: > Errors can occur during virtqueue_pop(), especially in > virtqueue_map_desc(). In order to handle this we must unmap iov[] > before returning NULL. The caller will consider the virtqueue empty and > the virtio_error() call will have marked the device broken. > > Signed-off-by: Stefan Hajnoczi > --- > hw/virtio/virtio.c | 74 ++++++++++++++++++++++++++++++++++++++++-------------- > 1 file changed, 55 insertions(+), 19 deletions(-) Reviewed-by: Cornelia Huck