[PATCH] virsh: Make domif-setlink work more than once

Ján Tomko jtomko at redhat.com
Mon Jan 30 10:14:21 UTC 2023


On a Monday in 2023, Michal Privoznik wrote:
>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 at redhat.com>
>---
> tools/virsh-domain.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230130/571cb7d2/attachment.sig>


More information about the libvir-list mailing list