From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av1my-00048Q-Pv for qemu-devel@nongnu.org; Tue, 26 Apr 2016 08:08:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1av1ms-0002HM-UG for qemu-devel@nongnu.org; Tue, 26 Apr 2016 08:08:24 -0400 From: Alberto Garcia In-Reply-To: References: Date: Tue, 26 Apr 2016 14:08:14 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-discuss] iolimits for virtio-9p List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pradeep Kiruvale , qemu-devel@nongnu.org, "qemu-discuss@nongnu.org" On Tue 19 Apr 2016 02:09:24 PM CEST, Pradeep Kiruvale wrote: > We are planning to implement the io-limits for the virtio-9p driver > i.e for fsdev devices. > So, I am looking into the code base and how it has done for the block > io devices. > > I would like to know how difficult is this and is there some one out > there who has any plan to do this? Hi, as Stefan said already, the common API is in throttle.h. It should be generic enough to be used in other parts of QEMU, but tell me if you feel that it needs changes. Once you configure the throttling settings you essentially only need to call throttle_schedule_timer() to see if a request needs to be throttled, and afterwards throttle_account() to register the I/O that has been peformed. You'll see that there's also throttle-group.c, but that's specific to the block layer and not meant to be generic. Berto