Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Descriptionyalzhang@redhat.com
2023-01-30 07:23:56 UTC
Description of problem:
Can not update interface link state by domif-setlink
Version-Release number of selected component (if applicable):
libvirt-9.0.0-2.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
1. prepare a vm with interface xml with link state setting:
# virsh dumpxml rhel --xpath //interface
<interface type="network">
<mac address="52:54:00:60:8a:32"/>
<source network="default"/>
<model type="virtio"/>
<link state="up"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>
2. start the vm, then live update the link state by domif-setlink:
# virsh start rhel
Domain 'rhel' started
# virsh domiflist rhel
Interface Type Source Model MAC
-------------------------------------------------------------
vnet3 network default virtio 52:54:00:60:8a:32
# virsh domif-setlink rhel vnet3 down
error: Failed to update interface link state
error: (device_definition):6: Attribute state redefined
<link state="up" state="down"/>
-----------------------------------^
Actual results:
In step 2, the xml parsing doesn't make sense
Expected results:
The domif-setlink should work properly
Additional info:
Fixed upstream by:
commit 6f3f6c0f763b9ffd8ef93eb124c88dd0b79138fc
Author: Michal Prívozník <mprivozn>
Date: Mon Jan 30 10:55:22 2023 +0100
virsh: Make domif-setlink work more than once
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>
Reviewed-by: Ján Tomko <jtomko>
Comment 3yalzhang@redhat.com
2023-02-02 07:41:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (libvirt bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2023:2171
Description of problem: Can not update interface link state by domif-setlink Version-Release number of selected component (if applicable): libvirt-9.0.0-2.el9.x86_64 How reproducible: 100% Steps to Reproduce: 1. prepare a vm with interface xml with link state setting: # virsh dumpxml rhel --xpath //interface <interface type="network"> <mac address="52:54:00:60:8a:32"/> <source network="default"/> <model type="virtio"/> <link state="up"/> <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/> </interface> 2. start the vm, then live update the link state by domif-setlink: # virsh start rhel Domain 'rhel' started # virsh domiflist rhel Interface Type Source Model MAC ------------------------------------------------------------- vnet3 network default virtio 52:54:00:60:8a:32 # virsh domif-setlink rhel vnet3 down error: Failed to update interface link state error: (device_definition):6: Attribute state redefined <link state="up" state="down"/> -----------------------------------^ Actual results: In step 2, the xml parsing doesn't make sense Expected results: The domif-setlink should work properly Additional info: