summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2016-03-16 19:54:29 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:49:38 -0600
commit0e38d67637c38aa4a19960aed29106c2d18f44b7 (patch)
treec1710e00482b597be7ef70b3b86cb8b06bf80729 /monitor.c
parentdde32b66f07783f335862c44a11cd5890a6107a8 (diff)
downloadhqemu-0e38d67637c38aa4a19960aed29106c2d18f44b7.zip
hqemu-0e38d67637c38aa4a19960aed29106c2d18f44b7.tar.gz
monitor: Use BB list for BB name completion
Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c7
1 files 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);
OpenPOWER on IntegriCloud