From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgTqc-0000v1-QJ for qemu-devel@nongnu.org; Fri, 10 Apr 2015 03:59:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgTqX-0001GP-Mw for qemu-devel@nongnu.org; Fri, 10 Apr 2015 03:59:30 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:39799 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgTqX-0000ol-GB for qemu-devel@nongnu.org; Fri, 10 Apr 2015 03:59:25 -0400 Date: Fri, 10 Apr 2015 09:58:34 +0200 From: Alberto Garcia Message-ID: <20150410075834.GA18121@igalia.com> References: <3060954d506be499c26d07ba4624dd33cd7b002d.1427732020.git.berto@igalia.com> <20150409142257.GE2783@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150409142257.GE2783@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH 4/7] throttle: Add throttle group support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Thu, Apr 09, 2015 at 03:22:57PM +0100, Stefan Hajnoczi wrote: > > @@ -1941,9 +1951,11 @@ void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd, > > aio_context_acquire(aio_context); > > > > if (!bs->io_limits_enabled && throttle_enabled(&cfg)) { > > - bdrv_io_limits_enable(bs); > > + bdrv_io_limits_enable(bs, has_group ? group : device); > > } else if (bs->io_limits_enabled && !throttle_enabled(&cfg)) { > > bdrv_io_limits_disable(bs); > > + } else if (bs->io_limits_enabled && throttle_enabled(&cfg)) { > > + bdrv_io_limits_update_group(bs, has_group ? group : device); > > } > > > > if (bs->io_limits_enabled) { > > The semantics are inconsistent: > > 1. Create drive0 with throttle group "mygroup". > 2. Issue block-set-io-throttle device="drive0" > > The result is that a new throttle group called "drive0" is created. > I expected to modify the throttling configuration for drive0 (i.e. > "mygroup"). That's right. What we can do is choose the group to update using the following criteria, in order of precedence: 1) The 'group' parameter from block-set-io-throttle. 2) The group the device is already member of. 3) A new group ("drive0" in this example). Currently we're not doing 2). > Now let's disable the throttle group: > > 3. Issue block-set-io-throttle with 0 values for device="drive0" > > The result is that "mygroup" is changed to all 0s. No, that simply removes the device from the group without touching its configuration: > > } else if (bs->io_limits_enabled && !throttle_enabled(&cfg)) { > > bdrv_io_limits_disable(bs); The group name passed by the user is actually not used in this case. Berto