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 1056902 - virsh attach-interface/detach-interface mishandles inactive configuration on device hot(un)plug commands
Summary: virsh attach-interface/detach-interface mishandles inactive configuration on ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-23 06:49 UTC by zhengqin
Modified: 2015-03-05 07:29 UTC (History)
8 users (show)

Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:29:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description zhengqin 2014-01-23 06:49:22 UTC
Description of problem:
virsh attach-interface/detach-interface with option "--config" could not success for running domain vm.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-19.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
Attach/detach with --config
steps:
1. attach-interface with --config when domain is running
# virsh list
 Id    Name                           State
----------------------------------------------------
 5     rhel6_x86_64                   running


# virsh attach-interface rhel6_x86_64  --type network --source default --target vnet1 --mac 52:54:00:f9:11:11 --config
Interface attached successfully


# virsh domiflist rhel6_x86_64 --inactive
Interface  Type       Source     Model       MAC
-------------------------------------------------------
-          network    default    e1000       52:54:00:62:30:ff
-          network    default    rtl8139     52:54:00:f9:11:11



2. detach-interface with --config

# virsh detach-interface rhel6_x86_64 network --mac 52:54:00:f9:11:11 --config
error: No interface with MAC address 52:54:00:f9:11:11 was found



Expected Result:
Interface could be detached successfully with –config.

Additional Info:
This issue does not occurs on RHEL6 with libvirt-0.10.2-29.el6.x86_64

Comment 2 CongDong 2014-02-21 09:30:18 UTC
Can reproduce with:
libvirt-1.1.1-23.el7.x86_64

Steps:
1. 
[root@mig2 Downloads]# rpm -qa libvirt
libvirt-1.1.1-23.el7.x86_64
[root@mig2 Downloads]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 3     rhel6                          running
 -     kiosk-test                     shut off
 -     new                            shut off
 -     rhel6u5                        shut off

[root@mig2 Downloads]# virsh attach-interface rhel6 --type network --source default --target vnet1 --mac 52:54:00:f9:11:11 --config
Interface attached successfully

[root@mig2 Downloads]# virsh domiflist rhel6 --inactive
Interface  Type       Source     Model       MAC
-------------------------------------------------------
-          network    default    virtio      52:54:00:56:b3:84
-          network    default    rtl8139     52:54:00:f9:11:11

2.
[root@mig2 Downloads]# virsh detach-interface rhel6 network --mac 52:54:00:f9:11:11 --config
error: Failed to detach interface
error: operation failed: no matching network device was found

Comment 3 Peter Krempa 2014-07-07 11:08:00 UTC
commit 87388228f47a15308aee4b6416e31596242bab41
Author: Peter Krempa <pkrempa>
Date:   Fri Jul 4 15:03:07 2014 +0200

    virsh: domain: Use inactive XML when unplugging interface with --config
    
    Similary to cmdDetachDisk fetch the inactive definition when --config
    is specified as the active may not contain the network interface
    if it was plugged with --config.

$ git desc
v1.2.6-56-g8738822

Comment 6 vivian zhang 2014-12-02 06:37:23 UTC
I can produce this bug on build libvirt-1.1.1-29.el7.x86_64

verify it on build
libvirt-1.2.8-9.el7.x86_64
qemu-kvm-rhev-2.1.2-14.el7.x86_64
3.10.0-208.el7.x86_64

1. prepare a guest in running and domiflist
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 96    rhel7new                       running
# virsh domiflist rhel7new --inactive
Interface  Type       Source     Model       MAC
-------------------------------------------------------
-          network    default    rtl8139     52:54:00:c2:c6:e4

2. hot plug a interface to guest with --config

# virsh attach-interface rhel7new --type network --source default --target vnet1 --mac 52:54:00:f9:11:11 --config
Interface attached successfully

# virsh domiflist rhel7new --inactive
Interface  Type       Source     Model       MAC
-------------------------------------------------------
-          network    default    rtl8139     52:54:00:c2:c6:e4
-          network    default    rtl8139     52:54:00:f9:11:11

3. detach it with --config success
# virsh detach-interface rhel7new network --mac 52:54:00:f9:11:11 --config
Interface detached successfully

# virsh domiflist rhel7new --inactive
Interface  Type       Source     Model       MAC
-------------------------------------------------------
-          network    default    rtl8139     52:54:00:c2:c6:e4

4. check guest still in running, works well

repeat steps 1-4 on qemu-kvm build, got the same result

build for qemu-kvm
qemu-kvm-1.5.3-83.el7.x86_64
libvirt-1.2.8-9.el7.x86_64
3.10.0-208.el7.x86_64

the similar steps for command attach-device

    virsh attach-device rhel7new --file /tmp/network.xml --config
    Device attached successfully

[root@server ~]# virsh domiflist rhel7new --inactive
Interface Type Source Model MAC
-------------------------------------------------------
- network default rtl8139 52:54:00:c2:c6:e4
- network default rtl8139 52:54:00:f9:11:11

    virsh detach-device rhel7new --file /tmp/network.xml --config
    Device detached successfully

[root@server ~]# virsh domiflist rhel7new --inactive
Interface Type Source Model MAC
-------------------------------------------------------
- network default rtl8139 52:54:00:c2:c6:e4

    virsh attach-device rhel7new --file /tmp/network.xml --config
    Device attached successfully

[root@server ~]# virsh detach-device rhel7new --file /tmp/network.xml
error: Failed to detach device from /tmp/network.xml
error: operation failed: no device matching mac address 52:54:00:f9:11:11 found on 0000:00:08.0

    virsh detach-device rhel7new --file /tmp/network.xml --live
    error: Failed to detach device from /tmp/network.xml
    error: operation failed: no device matching mac address 52:54:00:f9:11:11 found on 0000:00:08.0


move to verified

Comment 8 errata-xmlrpc 2015-03-05 07:29:35 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/RHSA-2015-0323.html


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