Received: from eggs.gnu.org ([2001:4830:134:3::10]:53304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1PYE-0003Zh-4v for qemu-devel@nongnu.org; Sat, 06 Jun 2015 21:39:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1PYA-00057m-Va for qemu-devel@nongnu.org; Sat, 06 Jun 2015 21:39:02 -0400 Received: from resqmta-po-09v.sys.comcast.net ([96.114.154.168]:37634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1PYA-00055y-OW for qemu-devel@nongnu.org; Sat, 06 Jun 2015 21:38:58 -0400 From: Eric Blake Date: Sat, 6 Jun 2015 19:38:51 -0600 Message-Id: <1433641131-24123-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH] block: allow write-threshold on device name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: kwolf@redhat.com, fromani@redhat.com Commit e2462113 allowed the ability to fire an event if a BDS node exceeds a threshold during a write, but limited the option to only work on node names. For convenience, expand this to allow a device name as a way to set the threshold on the BDS at the active layer of the device. Signed-off-by: Eric Blake --- block/write-threshold.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/write-threshold.c b/block/write-threshold.c index a53c1f5..e3df419 100644 --- a/block/write-threshold.c +++ b/block/write-threshold.c @@ -1,7 +1,7 @@ /* * QEMU System Emulator block write threshold notification * - * Copyright Red Hat, Inc. 2014 + * Copyright Red Hat, Inc. 2014, 2015 * * Authors: * Francesco Romani @@ -110,9 +110,8 @@ void qmp_block_set_write_threshold(const char *node_name, BlockDriverState *bs; AioContext *aio_context; - bs = bdrv_find_node(node_name); + bs = bdrv_lookup_bs(node_name, node_name, errp); if (!bs) { - error_setg(errp, "Device '%s' not found", node_name); return; } -- 2.4.2