Received: by 10.192.165.148 with SMTP id m20csp4186738imm; Mon, 30 Apr 2018 13:27:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr83HV/Z1WeobSBa3cRQ82qs9P1CPBv+pVjHdGfDCa+UI7ygyS0mL+P79cSfBHphj9F7QZ6 X-Received: by 10.98.224.76 with SMTP id f73mr13281605pfh.88.1525120046570; Mon, 30 Apr 2018 13:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525120046; cv=none; d=google.com; s=arc-20160816; b=VpEt18CTxcj2sIX7TF7ywuQLBXai/1gxS04PtdDKOPSv2lOhUswOtINTja6lCbKfVZ LXTQawT/hNBqswE1Zg01lAaJxPAeLbQ2/tDy/6cZVdPT1Rvv5LyCmP4xANWQQc5W2GHN DRupX5SUTRNVZGVxzD2dubbuVPz0K74D6r/6hF9oHhnIkoxkps2jz1kOQGJbRpHAMNDK +DdFucJHy7XFUDiORjCChMQAKD+DRxy2InefBiuentpOC4NCNyOuqYluzWw7DV/HRbPH 0r+lVAtrLNS6hG4eGBmi5I2leKj9+Dq2hfYS1i22sH16XIP0hkfisCZ6GNnpmgqda7TX oaVQ== 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=KIKUXR/ZdfgDzY4Cyyi/SIPMwI5mtEKTlQcvMM+MV+w=; b=eTxMTkRAwvpn0ria8sbQ6pS/DXFwPBB08UMpOIgfE4+UsgbBrVyKmAzX6pccms+wmu OBuTQvpKEIlde4b4CPR9rn/BdX00baoo+UA9Ly64a/TrYVNbJuKn7wf3NKDoc99JHAdK oRwMBfw1JAiOryJn2GQ6yA1+uLCn6KPuN8FPDvHVKq94XT1x0oOs7Ae5K2UStQ5Nb8w1 S5t6H1S2u+QKzG98zuPCmG/Usqz2ffEtL1CqclQsWY2rzHOWU49VyhFdWJVGGSnMl0bZ iUq3PygeCi4hM6aby4MLOQINfimGypzMQsMB0niiy1kqxrExBAJ59WD8emi1TunqegUT O2aA== 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 b6si8191866pfk.342.2018.04.30.13.27.12; Mon, 30 Apr 2018 13:27:26 -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 S1755621AbeD3T0Z (ORCPT + 99 others); Mon, 30 Apr 2018 15:26:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:59840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755584AbeD3T0U (ORCPT ); Mon, 30 Apr 2018 15:26:20 -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 13FA022DC9; Mon, 30 Apr 2018 19:26:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13FA022DC9 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.9 17/61] virtio: add ability to iterate over vqs Date: Mon, 30 Apr 2018 12:24:20 -0700 Message-Id: <20180430183952.653413630@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430183951.312721450@linuxfoundation.org> References: <20180430183951.312721450@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.9-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 @@ -143,6 +143,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).