mirror of
https://github.com/libvirt/libvirt.git
synced 2026-07-30 08:08:11 -05:00
virsh: Add --print-xml option for 'domif-setlink'
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
@@ -3120,6 +3120,10 @@ static const vshCmdOptDef opts_domif_setlink[] = {
|
||||
.help = "config"
|
||||
},
|
||||
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
|
||||
{.name = "print-xml",
|
||||
.type = VSH_OT_BOOL,
|
||||
.help = N_("print XML document rather than set the interface link state")
|
||||
},
|
||||
{.name = NULL}
|
||||
};
|
||||
|
||||
@@ -3238,6 +3242,11 @@ cmdDomIfSetLink(vshControl *ctl, const vshCmd *cmd)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (vshCommandOptBool(cmd, "print-xml")) {
|
||||
vshPrint(ctl, "%s", xml_buf);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (virDomainUpdateDeviceFlags(dom, xml_buf, flags) < 0) {
|
||||
vshError(ctl, _("Failed to update interface link state"));
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user