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 <ebl...@redhat.com>
---
 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 <from...@redhat.com>
@@ -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


Reply via email to