[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 01/17] monitor: Use BB list for BB name completio
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v4 01/17] monitor: Use BB list for BB name completion |
Date: |
Wed, 16 Mar 2016 19:54:29 +0100 |
Signed-off-by: Max Reitz <address@hidden>
---
monitor.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/monitor.c b/monitor.c
index 894f862..4c02f0f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -42,6 +42,7 @@
#include "ui/console.h"
#include "ui/input.h"
#include "sysemu/blockdev.h"
+#include "sysemu/block-backend.h"
#include "audio/audio.h"
#include "disas/disas.h"
#include "sysemu/balloon.h"
@@ -3483,7 +3484,7 @@ static void monitor_find_completion_by_table(Monitor *mon,
int i;
const char *ptype, *str, *name;
const mon_cmd_t *cmd;
- BlockDriverState *bs;
+ BlockBackend *blk = NULL;
if (nb_args <= 1) {
/* command completion */
@@ -3538,8 +3539,8 @@ static void monitor_find_completion_by_table(Monitor *mon,
case 'B':
/* block device name completion */
readline_set_completion_index(mon->rs, strlen(str));
- for (bs = bdrv_next(NULL); bs; bs = bdrv_next(bs)) {
- name = bdrv_get_device_name(bs);
+ while ((blk = blk_next(blk)) != NULL) {
+ name = blk_name(blk);
if (str[0] == '\0' ||
!strncmp(name, str, strlen(str))) {
readline_add_completion(mon->rs, name);
--
2.7.3
- [Qemu-devel] [PATCH v4 00/17] blockdev: Further BlockBackend work, Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 01/17] monitor: Use BB list for BB name completion,
Max Reitz <=
- [Qemu-devel] [PATCH v4 03/17] block: Add blk_commit_all(), Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 02/17] block: Use blk_next() in block-backend.c, Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 06/17] block: Drop BB name from bad option error, Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 04/17] block: Use blk_{commit, flush}_all() consistently, Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 07/17] blockdev: Rename blk_backends, Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 08/17] blockdev: Add list of all BlockBackends, Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 09/17] blockdev: Separate BB name management, Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 05/17] qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 13/17] block: Add bdrv_next_monitor_owned(), Max Reitz, 2016/03/16
- [Qemu-devel] [PATCH v4 10/17] blockdev: Split monitor reference from BB creation, Max Reitz, 2016/03/16