Bug 704057

Summary: hot delete virtio nic then migrate, dest guest become irresponsive
Product: Red Hat Enterprise Linux 5 Reporter: Chao Yang <chayang>
Component: kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.7CC: juzhang, michen, mkenneth, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-12 02:48:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Chao Yang 2011-05-12 02:05:06 UTC
Description of problem:
Please see following steps.

Version-Release number of selected component (if applicable):
kvm-83-232.el5.x86_64

How reproducible:
100%

Steps to Reproduce:
1. boot a guest with virtio nic by:
 /usr/libexec/qemu-kvm -M rhel5.6.0 -no-hpet -rtc-td-hack -startdate now -name rhel5.7 -smp 2 -m 2048 -cpu qemu64,+sse2 -uuid `uuidgen` -boot c -net nic,vlan=1,macaddr=F0:4D:A2:94:65:32,model=virtio -net tap,vlan=1,script=/etc/qemu-ifup -drive file=/opt/rhel5.7.qcow2,media=disk,if=virtio,cache=none,boot=on,format=qcow2 -vnc :1 -notify all -balloon none -monitor stdio
2. modprobe acpiphp in guest then hot unplug the virtio nic by:
 (qemu) info network
VLAN 1 devices:
  tap.0: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  virtio.0: model=virtio,macaddr=f0:4d:a2:94:65:32
(qemu) host_net_remove 1 tap.0
/etc/qemu-ifdown: could not launch network script
(qemu) info pci
  Bus  0, device   0, function 0:
    Host bridge: PCI device 8086:1237
  Bus  0, device   1, function 0:
    ISA bridge: PCI device 8086:7000
  Bus  0, device   1, function 1:
    IDE controller: PCI device 8086:7010
      BAR4: I/O at 0xc000 [0xc00f].
  Bus  0, device   1, function 3:
    Bridge: PCI device 8086:7113
      IRQ 9.
  Bus  0, device   2, function 0:
    VGA controller: PCI device 1013:00b8
      BAR0: 32 bit memory at 0xc2000000 [0xc3ffffff].
      BAR1: 32 bit memory at 0xc4000000 [0xc4000fff].
  Bus  0, device   3, function 0:
    Ethernet controller: PCI device 1af4:1000
      IRQ 11.
      BAR0: I/O at 0xc020 [0xc03f].
  Bus  0, device   4, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 11.
      BAR0: I/O at 0xc040 [0xc07f].
(qemu) pci_del pci_addr=0:3
(qemu) info network
VLAN 1 devices:
(qemu) info pci
  Bus  0, device   0, function 0:
    Host bridge: PCI device 8086:1237
  Bus  0, device   1, function 0:
    ISA bridge: PCI device 8086:7000
  Bus  0, device   1, function 1:
    IDE controller: PCI device 8086:7010
      BAR4: I/O at 0xc000 [0xc00f].
  Bus  0, device   1, function 3:
    Bridge: PCI device 8086:7113
      IRQ 9.
  Bus  0, device   2, function 0:
    VGA controller: PCI device 1013:00b8
      BAR0: 32 bit memory at 0xc2000000 [0xc3ffffff].
      BAR1: 32 bit memory at 0xc4000000 [0xc4000fff].
  Bus  0, device   4, function 0:
    SCSI controller: PCI device 1af4:1001
      IRQ 11.
      BAR0: I/O at 0xc040 [0xc07f].
check in guest, virtio nic indeed is hot deleted.
3. start a guest in listening mode by:
/usr/libexec/qemu-kvm -M rhel5.6.0 -no-hpet -rtc-td-hack -startdate now -name rhel5.7 -smp 2 -m 2048 -cpu qemu64,+sse2 -uuid `uuidgen` -boot c -net none -drive file=/opt/rhel5.7.qcow2,media=disk,if=virtio,cache=none,boot=on,format=qcow2 -vnc :1 -notify all -balloon none -monitor stdio -incoming tcp:0:8000
4. migrate the src guest:
 (qemu) migrate -d tcp:10.66.x.x:8000
(qemu) migration_notify_done
info migrate
Migration status: active
transferred ram: 53698 kbytes
remaining ram: 523500 kbytes
total ram: 2117644 kbytes
(qemu) migration_notify_done
info migrate
Migration status: completed
5. issue "lspci|grep Eth" in guest
  
Actual results:
After step 5, guest gives no response to "lspci|grep Eth" as well as other commands, I mean you can type in guest but hit "Enter" will output nothing, but monitor is alive and responsive.

Expected results:


Additional info:

Comment 1 Chao Yang 2011-05-12 02:20:14 UTC
Tried following scenario, hit same issue:
1. boot a guest without networking
 /usr/libexec/qemu-kvm -M rhel5.6.0 -no-hpet -rtc-td-hack -startdate now -name rhel5.7 -smp 2 -m 2048 -cpu qemu64,+sse2 -uuid `uuidgen` -boot c -net none -drive file=/opt/rhel5.7.qcow2,media=disk,if=virtio,cache=none,boot=on,format=qcow2 -vnc :1 -notify all -balloon none -monitor stdio
2. hot add a virtio nic
 (qemu) pci_add pci_addr=auto nic vlan=1,macaddr=F0:4D:A2:94:65:32,model=virtio
OK domain 0, bus 0, slot 4, function 0
(qemu) host_net_add tap vlan=1,script=/etc/qemu-ifup
(qemu) info network
VLAN 0 devices:
VLAN 1 devices:
  virtio.0: model=virtio,macaddr=f0:4d:a2:94:65:32
  tap.0: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
3. migrate
(qemu) migrate -d tcp:10.66.x.x:8000
(qemu) migration_notify_done
info migrate
Migration status: active
transferred ram: 83394 kbytes
remaining ram: 509352 kbytes
total ram: 2117644 kbytes
(qemu) migration_notify_done
info migrate
Migration status: completed
4. check in dest guest

Actual Result:
 hit same issue describes in Comment #0

Comment 2 Chao Yang 2011-05-12 02:48:45 UTC
Closing cause not support hot add/delete nic then migrate.