virsh: add interface information to guestinfo command

The new parameter group returns information about network interfaces

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
zhanglei
2021-10-15 18:07:48 +08:00
committed by Ján Tomko
parent 348758b1b5
commit c6d009620a
2 changed files with 16 additions and 2 deletions

View File

@@ -14077,6 +14077,10 @@ static const vshCmdOptDef opts_guestinfo[] = {
.type = VSH_OT_BOOL,
.help = N_("report disk information"),
},
{.name = "interface",
.type = VSH_OT_BOOL,
.help = N_("report interface information"),
},
{.name = NULL}
};
@@ -14102,6 +14106,8 @@ cmdGuestInfo(vshControl *ctl, const vshCmd *cmd)
types |= VIR_DOMAIN_GUEST_INFO_FILESYSTEM;
if (vshCommandOptBool(cmd, "disk"))
types |= VIR_DOMAIN_GUEST_INFO_DISKS;
if (vshCommandOptBool(cmd, "interface"))
types |= VIR_DOMAIN_GUEST_INFO_INTERFACES;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;