[PATCH 3/6] virsh: Add completer for '--type' option of 'detach-interface' command

Radosław Śmigielski via Devel posted 6 patches 2 months, 1 week ago
There is a newer version of this series
[PATCH 3/6] virsh: Add completer for '--type' option of 'detach-interface' command
Posted by Radosław Śmigielski via Devel 2 months, 1 week ago
From: Radoslaw Smigielski <rsmigiel@redhat.com>

The '--type' option of 'detach-interface' command specifies the
network interface type to detach.

Partially-fixes: https://gitlab.com/libvirt/libvirt/-/work_items/9
Signed-off-by: Radoslaw Smigielski <rsmigiel@redhat.com>
---
 tools/virsh-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index e6f2ca3a449a..79823072ad26 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -12785,6 +12785,7 @@ static const vshCmdOptDef opts_detach_interface[] = {
     {.name = "type",
      .type = VSH_OT_STRING,
      .positional = true,
+     .completer = virshDomainNetTypeCompleter,
      .help = N_("network interface type")
     },
     {.name = "mac",
-- 
2.54.0
Re: [PATCH 3/6] virsh: Add completer for '--type' option of 'detach-interface' command
Posted by Peter Krempa via Devel 2 months, 1 week ago
On Thu, Jul 09, 2026 at 15:00:59 +0200, Radosław Śmigielski via Devel wrote:
> From: Radoslaw Smigielski <rsmigiel@redhat.com>
> 
> The '--type' option of 'detach-interface' command specifies the
> network interface type to detach.

Note that the manpage explicitly mentions only two of the network types
but the code as-written supports every type.


> 
> Partially-fixes: https://gitlab.com/libvirt/libvirt/-/work_items/9
> Signed-off-by: Radoslaw Smigielski <rsmigiel@redhat.com>
> ---
>  tools/virsh-domain.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index e6f2ca3a449a..79823072ad26 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -12785,6 +12785,7 @@ static const vshCmdOptDef opts_detach_interface[] = {
>      {.name = "type",
>       .type = VSH_OT_STRING,
>       .positional = true,
> +     .completer = virshDomainNetTypeCompleter,
>       .help = N_("network interface type")
>      },
>      {.name = "mac",
> -- 
> 2.54.0
> 

Reviewed-by: Peter Krempa <pkrempa@redhat.com>