From 27e97d5c17ff695e31299ef378462055f07f9e3a Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Tue, 15 May 2018 19:18:24 +0800 Subject: [PATCH] virsh: Add target name completion for block device options Signed-off-by: Lin Ma Signed-off-by: Michal Privoznik --- tools/virsh-domain-monitor.c | 2 ++ tools/virsh-domain.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index fa93f3a312..39cb2ce7f0 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -391,6 +391,7 @@ static const vshCmdOptDef opts_domblkinfo[] = { {.name = "device", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("block device") }, {.name = "human", @@ -807,6 +808,7 @@ static const vshCmdOptDef opts_domblkstat[] = { {.name = "device", .type = VSH_OT_STRING, .flags = VSH_OFLAG_EMPTY_OK, + .completer = virshDomainDiskTargetCompleter, .help = N_("block device") }, {.name = "human", diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index bc44131fa2..cfbbf5a7bc 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -1090,6 +1090,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = { {.name = "device", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("block device") }, {.name = "total_bytes_sec", @@ -1886,6 +1887,7 @@ static const vshCmdOptDef opts_blockcommit[] = { {.name = "path", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("fully-qualified path of disk") }, {.name = "bandwidth", @@ -2111,6 +2113,7 @@ static const vshCmdOptDef opts_blockcopy[] = { {.name = "path", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("fully-qualified path of source disk") }, {.name = "dest", @@ -2427,6 +2430,7 @@ static const vshCmdOptDef opts_blockjob[] = { {.name = "path", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("fully-qualified path of disk") }, {.name = "abort", @@ -2670,6 +2674,7 @@ static const vshCmdOptDef opts_blockpull[] = { {.name = "path", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("fully-qualified path of disk") }, {.name = "bandwidth", @@ -2816,6 +2821,7 @@ static const vshCmdOptDef opts_blockresize[] = { {.name = "path", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("Fully-qualified path of block device") }, {.name = "size", @@ -7346,6 +7352,7 @@ static const vshCmdOptDef opts_domblkthreshold[] = { {.name = "dev", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("device to set threshold for") }, {.name = "threshold", @@ -13497,6 +13504,7 @@ static const vshCmdOptDef opts_change_media[] = { {.name = "path", .type = VSH_OT_DATA, .flags = VSH_OFLAG_REQ, + .completer = virshDomainDiskTargetCompleter, .help = N_("Fully-qualified path or target of disk device") }, {.name = "source",