Received: by 10.192.165.148 with SMTP id m20csp4196352imm; Mon, 30 Apr 2018 13:38:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqWAsPM3ZCPRgHy+YNY0dwbbvBlZikDydGsKK3f3SAwf0myWN7PLyUX66PoFmnHg+sEtnOD X-Received: by 2002:a65:65c4:: with SMTP id y4-v6mr6798463pgv.369.1525120717065; Mon, 30 Apr 2018 13:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525120717; cv=none; d=google.com; s=arc-20160816; b=vG6P5WuN7rpGUmitKXk+DLL747A9gN77TZY+i+kcRBv16qnvHSyHusM5Qu0BEP+Gtv g3oNh+8PMhuI0yMvDj0zfLDPfi/fneXoiMZ1pTmXXiNgfmwXKsRUkFZ0HrWck+fJnSc6 7KwfLDH5M+SLJ8KLay8nL1GKf5kdTaaztN5Kd8JOuFmKCHDkYECCsuCsmj6SrN4tiX8o AF0rUhPqEVJU5QuxBWw+lJwfGA5lYfFCMy9hfbZYXJs2EFPeZ9zZ51ZPt33GKT0VfltR 8hliXPTRxi85etKlTDFQbG4cKg9ND9mvEXYtq+26wo64zTgtKUB5jjpacjvpx5RdWDrX PrbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=qmtnGdj7beFgh8VlYDHfxlSvMOVG6Ra7EKR/Ql+9a+c=; b=PNLVC2S/0TtPPdwEmBZB1CPMc+aWm+34HNx+nxRWxM4qIiYL/bnILwjbB3MFwzqSer VE0N5pnO+C7fZ0DxxkUysx+2Ag71tEOZHqEahyEDqQqZkfvC7UpRo8Ttb/x6E8vqfYXw C/BsRTVeT3ef+iazIsho9VkHBXOtqe4ioyKOxagnGxpTYDVkZBAxmVPdml938Tcmopaw JMNxc8gbzDpmUzZE5dehFBs8x4c8bIb43z8BP9cffN4p7cA5OKjC5QbQuTb+2R4qIyb2 MH+Ry90Zj/WkdzQM6MPX59wKtqEMJscIotLQw+BlqWSA3d6l6i9RLFoa9LckaY0SMexa sJOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13si8261304pfc.128.2018.04.30.13.38.22; Mon, 30 Apr 2018 13:38:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755401AbeD3TZv (ORCPT + 99 others); Mon, 30 Apr 2018 15:25:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbeD3TZq (ORCPT ); Mon, 30 Apr 2018 15:25:46 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64E6F21746; Mon, 30 Apr 2018 19:25:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64E6F21746 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Michael S. Tsirkin" Subject: [PATCH 4.4 13/44] virtio: add ability to iterate over vqs Date: Mon, 30 Apr 2018 12:24:24 -0700 Message-Id: <20180430190946.877993030@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430190946.093694747@linuxfoundation.org> References: <20180430190946.093694747@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael S. Tsirkin commit 24a7e4d20783c0514850f24a5c41ede46ab058f0 upstream. For cleanup it's helpful to be able to simply scan all vqs and discard all data. Add an iterator to do that. Cc: stable@vger.kernel.org Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman --- include/linux/virtio.h | 3 +++ 1 file changed, 3 insertions(+) --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -124,6 +124,9 @@ int virtio_device_freeze(struct virtio_d int virtio_device_restore(struct virtio_device *dev); #endif +#define virtio_device_for_each_vq(vdev, vq) \ + list_for_each_entry(vq, &vdev->vqs, list) + /** * virtio_driver - operations for a virtio I/O driver * @driver: underlying device driver (populate name and owner).