mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: Introduce virshDomainInterfaceCompleter
For given domain fetch list of defined interfaces. This can be used for commands like domif-getlink and others. If available, the interface name is returned (e.g. "vnet0", usually available only for running domains), if not the MAC address is returned. Moreover, the detach-interface command requires only MAC address and therefore we have new flag that forces the completer to return just the MAC address. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
@@ -659,6 +659,7 @@ static const vshCmdOptDef opts_domif_getlink[] = {
|
||||
{.name = "interface",
|
||||
.type = VSH_OT_DATA,
|
||||
.flags = VSH_OFLAG_REQ,
|
||||
.completer = virshDomainInterfaceCompleter,
|
||||
.help = N_("interface device (MAC Address)")
|
||||
},
|
||||
{.name = "persistent",
|
||||
@@ -995,6 +996,7 @@ static const vshCmdOptDef opts_domifstat[] = {
|
||||
{.name = "interface",
|
||||
.type = VSH_OT_DATA,
|
||||
.flags = VSH_OFLAG_REQ,
|
||||
.completer = virshDomainInterfaceCompleter,
|
||||
.help = N_("interface device specified by name or MAC Address")
|
||||
},
|
||||
{.name = NULL}
|
||||
@@ -2149,6 +2151,7 @@ static const vshCmdOptDef opts_domifaddr[] = {
|
||||
{.name = "interface",
|
||||
.type = VSH_OT_STRING,
|
||||
.flags = VSH_OFLAG_NONE,
|
||||
.completer = virshDomainInterfaceCompleter,
|
||||
.help = N_("network interface name")},
|
||||
{.name = "full",
|
||||
.type = VSH_OT_BOOL,
|
||||
|
||||
Reference in New Issue
Block a user