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.
Bug 1141119 - virsh domif-getlink cmd gets "default" which is a invalid link state.
Summary: virsh domif-getlink cmd gets "default" which is a invalid link state.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-12 09:13 UTC by lcheng
Modified: 2015-11-19 05:46 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.2.14-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:46:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description lcheng 2014-09-12 09:13:31 UTC
Description of problem:
virsh domif-getlink cmd gets 'default' which is a invalid link state. Values for link state are 'up' or 'down' in virsh's manual and libvirt docs.

Version-Release number of selected component (if applicable):
libvirt-1.2.8-2.el7.x86_64
libvirt-docs-1.2.8-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
[root@localhost ~]# virsh dumpxml a | grep interface -A5
<interface type='network'>
<mac address='52:54:00:e9:4b:7a'/>
<source network='network'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

[root@localhost ~]# virsh domif-getlink a 52:54:00:e9:4b:7a
52:54:00:e9:4b:7a default

[root@localhost ~]# virsh domif-setlink a 52:54:00:e9:4b:7a default
error: invalid link state 'default'

[root@localhost ~]# man virsh
...
domif-setlink domain interface-device state [--config]
Modify link state of the domain's virtual interface. Possible values for state are "up" and "down.
...
domif-getlink domain interface-device [--config]
Query link state of the domain's virtual interface. If --config is specified, query the persistent configuration, for compatibility purposes, --persistent is alias of --config.
interface-device can be the interface's target name or the MAC address.
...

[root@localhost ~]# firefox file:///usr/share/doc/libvirt-docs-1.2.8/html/formatdomain.html#elementLink
...
Modifying virtual link state

This element provides means of setting state of the virtual network link. Possible values for attribute state are up and down. If down is specified as the value, the interface behaves as if it had the network cable disconnected. Default behavior if this element is unspecified is to have the link state up.

Actual results:
As description.

Expected results:
If link state element is unspecified in xml, virsh domif-getlink cmd should get 'up'.

Comment 2 dyuan 2014-09-15 09:33:29 UTC
Hi lcheng, please check the comment in bug 890483.
https://bugzilla.redhat.com/show_bug.cgi?id=890483#c4

Comment 4 lcheng 2014-09-15 10:15:23 UTC
> Hi lcheng, please check the comment in bug 890483.
> https://bugzilla.redhat.com/show_bug.cgi?id=890483#c4


Hi dyuan, if the domif-getlink returns 'default' which means 'up', it should be documented. Otherwise users will be confused.

Comment 5 Peter Krempa 2015-03-04 13:56:27 UTC
Fixed upstream:
commit d9c7f014ee7c23d25483acf4bce344fae169f1dd
Author: Erik Skultety <eskultet>
Date:   Tue Feb 24 17:25:55 2015 +0100

    virsh: tweak domif-getlink link state reporting message
    
    According to docs, we only support 2 link states for an interface
    up/down, 'up' being the default state if link state is unspecified in
    domain's XML, so the message when no link state is provided should be
    changed a little.

v1.2.13-55-gd9c7f01

Comment 8 hongming 2015-07-13 07:21:38 UTC
Verify it as follows. The result is expected. Move its status to VERIFIED.

# rpm -q libvirt
libvirt-1.2.17-1.el7.x86_64

# virsh dumpxml rhel7.0|grep /interface -B7
    <interface type='network'>
      <mac address='52:54:00:68:ce:60'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# virsh domif-getlink rhel7.0 52:54:00:68:ce:60
52:54:00:68:ce:60 up

# virsh domif-setlink rhel7.0 52:54:00:68:ce:60 down
Device updated successfully

# virsh domif-getlink rhel7.0 52:54:00:68:ce:60
52:54:00:68:ce:60 down

# virsh domif-setlink rhel7.0 52:54:00:68:ce:60 up
Device updated successfully

# virsh dumpxml rhel7.0|grep /interface -B7
      <mac address='52:54:00:68:ce:60'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <link state='up'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

Comment 10 errata-xmlrpc 2015-11-19 05:46:56 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, 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://rhn.redhat.com/errata/RHBA-2015-2202.html


Note You need to log in before you can comment on or make changes to this bug.