Received: by 10.192.165.148 with SMTP id m20csp4177444imm; Mon, 30 Apr 2018 13:15:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZobQx+ySgtTPIq8tkj8798ZiWXJGHH9GlI24D5YLZPTwVAkpV9a5GX55phjd4pWdvVIE7Av X-Received: by 2002:a17:902:1c8:: with SMTP id b66-v6mr13392558plb.156.1525119328364; Mon, 30 Apr 2018 13:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525119328; cv=none; d=google.com; s=arc-20160816; b=h2ElBtJhbPv1mA7xqElwWKIeNtsmpHcASHkOE+9uZD7tt6UVroyEByBXNUCXOHYFqO cQeRo+WxIvh9DW5WKLAtLZFtNY3s1Ar8TzAF6xvYRhfAcxpLFwI8MtLG6dxkBOTlGGSE 24A2OpteXcTKdR3T0qa6LQheDBaIm2nkMtZt+qVqsj8t2MSvHjnh8rOUG2FkhVMm017M lkwe7O0Ou8W8kTkoG6841eH6QOrysU6Ssc927SN8/nAS4wdzMpmPS+K4sjGnd/5l9Nuf RIhmhI2GgO63OBJ+ngWwITCyGevvfjpUFzHwNhrY5N8Y/LljcZwwbeRvhHdGBzBaqOpm tC/A== 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=ERtOmHMNwXqfZbRkV3PII5qylkUNGwRwzSJ/Bd0Nqjc=; b=vaQVYFsxL9agiSTZ7+r6lz4H1563tsHkFpa5OiArShEpDIc8IBsUoWCpucLwnpTXUW NjSt0dv7Z0UensKpe0C0+Aqe7O/eo/XSxoAWUZElvfqLT2mGsx5agD8bNf3NYqu/+JnY E4lg6KLn7D750IER5LavmzW4rQHlS7mLuY7IqgmGSEd+bB+J17i9XSX2zdJlUrGyU/HI js3w0ftMyhPQ3fUg4PGQZ31x8T9EhXPUJB5o5LVYZv1IKC6SFbeI7ZmibPmqBUKo5Ous QjEv5b7WfPxyhPpq3+D/7CPNKSKD3esZAatKbJqZomYvyQS4fgFYjpNXfjnK727MAivY 7IuA== 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 i14-v6si2227567pgp.558.2018.04.30.13.15.14; Mon, 30 Apr 2018 13:15:28 -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 S1755954AbeD3UPF (ORCPT + 99 others); Mon, 30 Apr 2018 16:15:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:33160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932104AbeD3T1D (ORCPT ); Mon, 30 Apr 2018 15:27:03 -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 455A022DAC; Mon, 30 Apr 2018 19:27:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 455A022DAC 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.14 22/91] virtio: add ability to iterate over vqs Date: Mon, 30 Apr 2018 12:24:04 -0700 Message-Id: <20180430184005.367272127@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184004.216234025@linuxfoundation.org> References: <20180430184004.216234025@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.14-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 @@ -157,6 +157,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).