Bug 1179138 - virt-manager does not show the new added hot-plug devices immediately after virsh command attach device successfully
Summary: virt-manager does not show the new added hot-plug devices immediately after v...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Giuseppe Scrivano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1206114 1212168
Blocks: 1205796
TreeView+ depends on / blocked
 
Reported: 2015-01-06 10:02 UTC by vivian zhang
Modified: 2015-11-19 05:23 UTC (History)
7 users (show)

Fixed In Version: virt-manager-1.2.0-1-el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1206114 (view as bug list)
Environment:
Last Closed: 2015-11-19 05:23:21 UTC
Target Upstream Version:


Attachments (Terms of Use)


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

Description vivian zhang 2015-01-06 10:02:30 UTC
Description:
virt-manager does not show the new added hot-plug devices immediately after virsh command attach device successfully,

Product version
virt-manager-1.1.0-10.el7.noarch
libvirt-1.2.8-11.el7.x86_64
qemu-kvm-rhev-2.1.2-17.el7.x86_64
3.10.0-220.el7.x86_64

How producible
100%

Steps:
1. Prepare a running guest, works well, check the network device in guest and virt-manager
# virsh list
 Id    Name                           State
----------------------------------------------------
 7     rhel7                          running

2. Dumpxml guest for interface list, also checks it in guest
# virsh dumpxml rhel
...
 <interface type='network'>
      <mac address='52:54:00:c6:3b:95'/>
      <source network='default' bridge='virbr0'/>
      <bandwidth>
        <inbound average='1000' peak='5000' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <driver name='vhost' queues='5'/>
      <link state='down'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
    </interface>
...

# virsh domiflist rhel7
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet2      network    default    virtio      52:54:00:c6:3b:95

in guest:
# lspci |grep Eth
00:10.0 Ethernet controller: Red Hat, Inc Virtio network device

2. Prepare a network xml, attach it to the guest
# cat /tmp/network1.xml
 <interface type='network'>
      <mac address='52:54:00:b0:8d:2c'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
    </interface>

# virsh attach-device rhel7 /tmp/network1.xml
Device attached successfully

3. Recheck the guest interface list and dumpxml to confirm the network device has been hot-plugged to guest success
# virsh domiflist rhel7
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet2      network    default    virtio      52:54:00:c6:3b:95
vnet3      network    default    rtl8139     52:54:00:b0:8d:2c

# virsh dumpxml rhel
...
<interface type='network'>
      <mac address='52:54:00:c6:3b:95'/>
      <source network='default' bridge='virbr0'/>
      <bandwidth>
        <inbound average='1000' peak='5000' burst='1024'/>
        <outbound average='128' peak='256' burst='256'/>
      </bandwidth>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <driver name='vhost' queues='5'/>
      <link state='down'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:b0:8d:2c'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet3'/>
      <model type='rtl8139'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...

4. in guest, network exist
# lspci |grep Eth
00:03.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev 20)  ----> the is the new added hot-plug network device
00:10.0 Ethernet controller: Red Hat, Inc Virtio network device

5. check with virt-manager for the new added hot-plug network interface device, click "Show virtual hardware details" menu.
the new added NIC device doest not shown, only the old one can be seen.

6. Close virt-manger window and open it again,  or restart libvirtd, the new added hot-plug devices can be seen from virt-manger.

Additional info:
The same issue also hit on hot-plug for disk, console, usb hostdev devices.

Actual result:
Although, virsh command has attached device successfully, but virt-manager does not sync with guest new added hot-plug devices immediately. It is abnormal.

Expected result:
Virt-manage can sync with virsh command immediately for hot-plug device attach.

Comment 2 tingting zheng 2015-01-06 10:54:52 UTC
The bug can not be reproduce on rhel7.0 release version(virt-manager-0.10.0-20.el7).

Comment 6 Giuseppe Scrivano 2015-02-24 18:06:59 UTC
it seems that libvirt doesn't have an event for this, and virt-manager passed from polling libvirt status to be event-driven.  I will investigate this better to be sure about it.

Comment 8 Ján Tomko 2015-04-29 09:01:55 UTC
Proposed patch:
https://www.redhat.com/archives/virt-tools-list/2015-April/msg00196.html

Comment 9 Giuseppe Scrivano 2015-04-29 14:46:10 UTC
commit be7611b645e2e888a0decc4c02f411a967ccee80
Author: Ján Tomko <jtomko>
Date:   Wed Apr 29 11:00:40 2015 +0200

    connection: refresh domain XML on device hotplug
    
    Listen to the VIR_DOMAIN_EVENT_ID_DEVICE_ADDED event
    too, added by libvirt 1.2.15.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1179138
    
    Signed-off-by: Ján Tomko <jtomko>

Comment 11 fwu 2015-06-03 09:04:42 UTC
I can reproduce this bug with following product versions:
virt-manager-1.1.0-12.el7.noarch
libvirt-1.2.8-11.el7.x86_64
libvirt-python-1.2.8-1.el7.x86_64

Steps are the same as description.

Then verify with the latest versions:
virt-manager-1.2.0-4.el7.noarch
libvirt-1.2.15-2.el7.x86_64
libvirt-python-1.2.15-1.el7.x86_64

Steps:
1. Prepare a running guest, works well, check the network device in guest and virt-manager
# virsh list
 Id    Name                           State
----------------------------------------------------
 3     rhel6.7                          running

2. Dumpxml guest for interface list, also checks it in guest
# virsh dumpxml rhel6.7
...
   <interface type='network'>
      <mac address='52:54:00:b7:29:90'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

...

# virsh domiflist rhel6.7
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet0      network    default    virtio      52:54:00:b7:29:90


in guest:
# lspci |grep Eth
00:03.0 Ethernet controller: Red Hat, Inc Virtio network device

2. Prepare a network xml, attach it to the guest
# cat /tmp/network1.xml
 <interface type='network'>
      <mac address='52:54:00:b0:8d:2c'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
    </interface>

# virsh attach-device rhel6.7 /tmp/network1.xml
Device attached successfully

3. Recheck the guest interface list and dumpxml to confirm the network device has been hot-plugged to guest success
# virsh domiflist rhel6.7
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet0      network    default    virtio      52:54:00:b7:29:90
vnet1      network    default    rtl8139     52:54:00:b0:8d:2c

# virsh dumpxml rhel6.7
...
    <interface type='network'>
      <mac address='52:54:00:b7:29:90'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
   <interface type='network'>
      <mac address='52:54:00:b0:8d:2c'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet1'/>
      <model type='rtl8139'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
...

4. In guest, network exist
# lspci |grep Eth
00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
00:09.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev 20)   ----> This is the new added hot-plug network device

5. Check with virt-manager for the new added hot-plug network interface device, click "Show virtual hardware details" menu.

Result:
After Step 5, virt-manager can sync with virsh command immediately for hot-plug device attach.

According to the result above in the latest version, move this bug from ON_QA to VERIFIED.

Comment 14 errata-xmlrpc 2015-11-19 05:23:21 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-2206.html


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