mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
6f3f6c0f76
In virsh, we have this convenient domif-setlink command, which is just a wrapper over virDomainUpdateDeviceFlags() and which allows setting link state of given guest NIC. It does so by fetching corresponding <interface/> XML snippet and either putting <link state=''/> into it, OR if the element already exists setting the attribute to desired value. The XML is then fed into the update API. There's, however, a small bug in detecting the pre-existence of the element and its attribute. The code looks at "link" attribute, while in fact, the attribute is called "state". Resolves: https://gitlab.com/libvirt/libvirt/-/issues/426 Fixes: e575bf082ed4889280be07c986375f1ca15bb7ee Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>