From patchwork Sun Jun 7 01:38:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 481694 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C2231400A0 for ; Sun, 7 Jun 2015 11:39:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=comcast.net header.i=@comcast.net header.b=pGGniVzU; dkim-atps=neutral Received: from localhost ([::1]:53164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1PYR-0003qJ-Iy for incoming@patchwork.ozlabs.org; Sat, 06 Jun 2015 21:39:15 -0400 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 Received: from resomta-po-05v.sys.comcast.net ([96.114.154.229]) by resqmta-po-09v.sys.comcast.net with comcast id dDet1q0044xDoy801DewZN; Sun, 07 Jun 2015 01:38:56 +0000 Received: from red.redhat.com ([24.10.254.122]) by resomta-po-05v.sys.comcast.net with comcast id dDer1q00A2fD5rL01Devb5; Sun, 07 Jun 2015 01:38:55 +0000 From: Eric Blake To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Sat, 6 Jun 2015 19:38:51 -0600 Message-Id: <1433641131-24123-1-git-send-email-eblake@redhat.com> X-Mailer: git-send-email 2.4.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1433641136; bh=X5IQcJf5w6eHQGFA5u0PxbzGSbv+3tVnkw3mpoGFj4Q=; h=Received:Received:From:To:Subject:Date:Message-Id; b=pGGniVzUX5XR0i+yixMozbv+lYd6AIyKbcLbvdxVp0uZz+VHl5tC19dEexA7YnSZ1 mqN/rbI32sVJU/AB4stSrnIEAnvS08xTuvoCSpnemgNrN6xrjzUCPLzFvW84S6RpYj tOmhHLN/0iuO9/YP5m/HqRVsQYj45wNMK6vRqsSF7W/Fz1XhMgU6J8DyFYD8uTqAUC mOlSkiuFiDVly8Cmo+V0/1NpugvjgKj97mRrdVr43XI8MUxvx3YqAIjWTKbL0ePmWU +CxZRVa1c/iIJUs/6PiUMeUwADK64Bh9tUD7Ww0GGROO36BdNux63yookLn8DwZk2H Jo2hacHZ1hdpg== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 96.114.154.168 Cc: kwolf@redhat.com, fromani@redhat.com Subject: [Qemu-devel] [PATCH] block: allow write-threshold on device name X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }