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.

Bug 1110189

Summary: migration can not finish with 1024k 'remaining ram' left after hotunplug 4 nics
Product: Red Hat Enterprise Linux 7 Reporter: Libor Miksik <lmiksik>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, dgilbert, hhuang, huding, jherrman, juli, juzhang, knoel, lmiksik, mazhang, mrezanin, pm-eus, qiguo, qzhang, tdosek, virt-maint
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-60.el7_0.3 Doc Type: Bug Fix
Doc Text:
Previously, the QEMU migration code did not account for the gaps caused by hot unplugged devices and thus expected more memory to be transferred during migrations. As a consequence, a guest migration failed to complete after multiple devices were hot unplugged. In addition, the migration info text afterwards displayed erroneous values for the "remaining ram" item. With this update, QEMU calculates memory after a device has been unplugged correctly, and any subsequent guest migrations proceed as expected.
Story Points: ---
Clone Of: 1074913 Environment:
Last Closed: 2014-07-23 16:18:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1074913    
Bug Blocks: 1110706    

Description Libor Miksik 2014-06-17 08:08:08 UTC
This bug has been copied from bug #1074913 and has been proposed
to be backported to 7.0 z-stream (EUS).

Comment 3 Miroslav Rezanina 2014-06-17 15:37:35 UTC
Fix included in qemu-kvm-1.5.3-60.el7_0.3

Comment 5 huiqingding 2014-06-20 07:53:36 UTC
Reproduce this bug using the following version:
qemu-kvm-1.5.3-60.el7.x86_64
kernel-3.10.0-128.el7.x86_64

Steps to Reproduce:
1. boot a win8-32 guest on src host
/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff \
-m 2G \
-smp 4,sockets=2,cores=2,threads=1,maxcpus=16 \
-enable-kvm \
-name win8 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-rtc base=localtime,clock=host,driftfix=slew \
-nodefaults \
-monitor stdio \
-qmp tcp:localhost:6666,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-vga cirrus \
-vnc :0 \
-drive file=/home/win8-32-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \
-netdev tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:13:10:10,bus=pci.0,addr=0x4 \
-netdev tap,id=hostnet1,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest1 \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:13:10:11,bus=pci.0,addr=0x5 \
-netdev tap,id=hostnet2,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest2 \
-device virtio-net-pci,netdev=hostnet2,id=net2,mac=52:54:00:13:10:12,bus=pci.0,addr=0x6 \
-netdev tap,id=hostnet3,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest3 \
-device virtio-net-pci,netdev=hostnet3,id=net3,mac=52:54:00:13:10:13,bus=pci.0,addr=0x7 \
2. unhotplug four nics
# telnet localhost 6666
Trying ::1...
Connected to localhost.
Escape character is '^]'.
{"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1}, "package": " (qemu-kvm-1.5.3-60.el7)"}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute": "device_del", "arguments": {"id": "net0"}}
{"return": {}}
{"timestamp": {"seconds": 1403250008, "microseconds": 416150}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net0/virtio-backend"}}
{"timestamp": {"seconds": 1403250008, "microseconds": 416302}, "event": "DEVICE_DELETED", "data": {"device": "net0", "path": "/machine/peripheral/net0"}}
{"execute": "device_del", "arguments": {"id": "net1"}}
{"return": {}}
{"timestamp": {"seconds": 1403250012, "microseconds": 251351}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net1/virtio-backend"}}
{"timestamp": {"seconds": 1403250012, "microseconds": 251507}, "event": "DEVICE_DELETED", "data": {"device": "net1", "path": "/machine/peripheral/net1"}}
{"execute": "device_del", "arguments": {"id": "net2"}}
{"return": {}}
{"timestamp": {"seconds": 1403250017, "microseconds": 624422}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net2/virtio-backend"}}
{"timestamp": {"seconds": 1403250017, "microseconds": 624588}, "event": "DEVICE_DELETED", "data": {"device": "net2", "path": "/machine/peripheral/net2"}}
{"execute": "device_del", "arguments": {"id": "net3"}}
{"return": {}}
{"timestamp": {"seconds": 1403250021, "microseconds": 721016}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net3/virtio-backend"}}
{"timestamp": {"seconds": 1403250021, "microseconds": 721165}, "event": "DEVICE_DELETED", "data": {"device": "net3", "path": "/machine/peripheral/net3"}}
{"execute": "netdev_del", "arguments": {"id": "hostnet0"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet1"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet2"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet3"}}
{"return": {}}
3. do migration 
(qemu) migrate -d tcp:10.66.9.152:5800
4. check migration status in src qemu-kvm

Actual results:
migration can not finish with 1024k 'remaining ram' left
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: active
total time: 298815 milliseconds
expected downtime: 30 milliseconds
setup: 10 milliseconds
transferred ram: 1346813 kbytes
throughput: 41.92 mbps
remaining ram: 1024 kbytes
total ram: 2113872 kbytes
duplicate: 388816 pages
skipped: 0 pages
normal: 139652 pages
normal bytes: 558608 kbytes

Additional info:
I also test rhel7 guest, also hit this issue.

Comment 6 huiqingding 2014-06-20 08:49:05 UTC
Reproduce this bug using the following version:
qemu-kvm-1.5.3-64.el7.x86_64
kernel-3.10.0-128.el7.x86_64

Steps to Reproduce:
1. boot a win8-32 guest on src host
/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff \
-m 2G \
-smp 4,sockets=2,cores=2,threads=1,maxcpus=16 \
-enable-kvm \
-name win8 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-rtc base=localtime,clock=host,driftfix=slew \
-nodefaults \
-monitor stdio \
-qmp tcp:localhost:6666,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-vga cirrus \
-vnc :0 \
-drive file=/home/win8-32-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \
-netdev tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:13:10:10,bus=pci.0,addr=0x4 \
-netdev tap,id=hostnet1,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest1 \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:13:10:11,bus=pci.0,addr=0x5 \
-netdev tap,id=hostnet2,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest2 \
-device virtio-net-pci,netdev=hostnet2,id=net2,mac=52:54:00:13:10:12,bus=pci.0,addr=0x6 \
-netdev tap,id=hostnet3,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest3 \
-device virtio-net-pci,netdev=hostnet3,id=net3,mac=52:54:00:13:10:13,bus=pci.0,addr=0x7 \
2. unhotplug four nics
# telnet localhost 6666
Trying ::1...
Connected to localhost.
Escape character is '^]'.
{"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1}, "package": " (qemu-kvm-1.5.3-60.el7)"}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute": "device_del", "arguments": {"id": "net0"}}
{"return": {}}
{"timestamp": {"seconds": 1403250008, "microseconds": 416150}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net0/virtio-backend"}}
{"timestamp": {"seconds": 1403250008, "microseconds": 416302}, "event": "DEVICE_DELETED", "data": {"device": "net0", "path": "/machine/peripheral/net0"}}
{"execute": "device_del", "arguments": {"id": "net1"}}
{"return": {}}
{"timestamp": {"seconds": 1403250012, "microseconds": 251351}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net1/virtio-backend"}}
{"timestamp": {"seconds": 1403250012, "microseconds": 251507}, "event": "DEVICE_DELETED", "data": {"device": "net1", "path": "/machine/peripheral/net1"}}
{"execute": "device_del", "arguments": {"id": "net2"}}
{"return": {}}
{"timestamp": {"seconds": 1403250017, "microseconds": 624422}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net2/virtio-backend"}}
{"timestamp": {"seconds": 1403250017, "microseconds": 624588}, "event": "DEVICE_DELETED", "data": {"device": "net2", "path": "/machine/peripheral/net2"}}
{"execute": "device_del", "arguments": {"id": "net3"}}
{"return": {}}
{"timestamp": {"seconds": 1403250021, "microseconds": 721016}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net3/virtio-backend"}}
{"timestamp": {"seconds": 1403250021, "microseconds": 721165}, "event": "DEVICE_DELETED", "data": {"device": "net3", "path": "/machine/peripheral/net3"}}
{"execute": "netdev_del", "arguments": {"id": "hostnet0"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet1"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet2"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet3"}}
{"return": {}}
3. do migration 
(qemu) migrate -d tcp:10.66.9.152:5800
4. check migration status in src qemu-kvm

Actual results:
migration can finish normally, remaining ram is 0k.
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: completed
total time: 57862 milliseconds
downtime: 32 milliseconds
setup: 10 milliseconds
transferred ram: 663613 kbytes
throughput: 98.01 mbps
remaining ram: 0 kbytes
total ram: 2113872 kbytes
duplicate: 452422 pages
skipped: 0 pages
normal: 164586 pages
normal bytes: 658344 kbytes
(qemu) info status
VM status: paused (postmigrate)


Additional info:
I also test the following scenarios, migration can finish normally, remaining ram is 0k.
1). boot win8-32 guest, unhotplug 5/6 nics then do migration
2). boot rhel7 guest, unhotplug 4/5/6 nics then do migration

Comment 7 huiqingding 2014-06-20 09:00:35 UTC
(In reply to huiqingding from comment #6)
> Reproduce this bug using the following version:
> qemu-kvm-1.5.3-64.el7.x86_64
> kernel-3.10.0-128.el7.x86_64
> 
sorry, "Reproduce" should be "Verify"

> Steps to Reproduce:
should be:
Steps to Verify:
> 1. boot a win8-32 guest on src host
> /usr/libexec/qemu-kvm \
> -M pc \
> -cpu SandyBridge,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff \
> -m 2G \
> -smp 4,sockets=2,cores=2,threads=1,maxcpus=16 \
> -enable-kvm \
> -name win8 \
> -uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
> -smbios type=1,manufacturer='Red Hat',product='RHEV
> Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-
> e63fcdb67170 \
> -k en-us \
> -rtc base=localtime,clock=host,driftfix=slew \
> -nodefaults \
> -monitor stdio \
> -qmp tcp:localhost:6666,server,nowait \
> -boot menu=on \
> -bios /usr/share/seabios/bios.bin \
> -vga cirrus \
> -vnc :0 \
> -drive
> file=/home/win8-32-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,
> cache=none,werror=stop,rerror=stop,aio=threads \
> -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,
> id=virtio-disk0,bootindex=0 \
> -netdev
> tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,
> ifname=guest0 \
> -device
> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:13:10:10,bus=pci.0,
> addr=0x4 \
> -netdev
> tap,id=hostnet1,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,
> ifname=guest1 \
> -device
> virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:13:10:11,bus=pci.0,
> addr=0x5 \
> -netdev
> tap,id=hostnet2,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,
> ifname=guest2 \
> -device
> virtio-net-pci,netdev=hostnet2,id=net2,mac=52:54:00:13:10:12,bus=pci.0,
> addr=0x6 \
> -netdev
> tap,id=hostnet3,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,
> ifname=guest3 \
> -device
> virtio-net-pci,netdev=hostnet3,id=net3,mac=52:54:00:13:10:13,bus=pci.0,
> addr=0x7 \
> 2. unhotplug four nics
> # telnet localhost 6666
> Trying ::1...
> Connected to localhost.
> Escape character is '^]'.
> {"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1},
> "package": " (qemu-kvm-1.5.3-60.el7)"}, "capabilities": []}}
> {"execute":"qmp_capabilities"}
> {"return": {}}
> {"execute": "device_del", "arguments": {"id": "net0"}}
> {"return": {}}
> {"timestamp": {"seconds": 1403250008, "microseconds": 416150}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/net0/virtio-backend"}}
> {"timestamp": {"seconds": 1403250008, "microseconds": 416302}, "event":
> "DEVICE_DELETED", "data": {"device": "net0", "path":
> "/machine/peripheral/net0"}}
> {"execute": "device_del", "arguments": {"id": "net1"}}
> {"return": {}}
> {"timestamp": {"seconds": 1403250012, "microseconds": 251351}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/net1/virtio-backend"}}
> {"timestamp": {"seconds": 1403250012, "microseconds": 251507}, "event":
> "DEVICE_DELETED", "data": {"device": "net1", "path":
> "/machine/peripheral/net1"}}
> {"execute": "device_del", "arguments": {"id": "net2"}}
> {"return": {}}
> {"timestamp": {"seconds": 1403250017, "microseconds": 624422}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/net2/virtio-backend"}}
> {"timestamp": {"seconds": 1403250017, "microseconds": 624588}, "event":
> "DEVICE_DELETED", "data": {"device": "net2", "path":
> "/machine/peripheral/net2"}}
> {"execute": "device_del", "arguments": {"id": "net3"}}
> {"return": {}}
> {"timestamp": {"seconds": 1403250021, "microseconds": 721016}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/net3/virtio-backend"}}
> {"timestamp": {"seconds": 1403250021, "microseconds": 721165}, "event":
> "DEVICE_DELETED", "data": {"device": "net3", "path":
> "/machine/peripheral/net3"}}
> {"execute": "netdev_del", "arguments": {"id": "hostnet0"}}
> {"return": {}}
> {"execute": "netdev_del", "arguments": {"id": "hostnet1"}}
> {"return": {}}
> {"execute": "netdev_del", "arguments": {"id": "hostnet2"}}
> {"return": {}}
> {"execute": "netdev_del", "arguments": {"id": "hostnet3"}}
> {"return": {}}
> 3. do migration 
> (qemu) migrate -d tcp:10.66.9.152:5800
> 4. check migration status in src qemu-kvm
> 
> Actual results:
> migration can finish normally, remaining ram is 0k.
> (qemu) info migrate
> capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off
> zero-blocks: off 
> Migration status: completed
> total time: 57862 milliseconds
> downtime: 32 milliseconds
> setup: 10 milliseconds
> transferred ram: 663613 kbytes
> throughput: 98.01 mbps
> remaining ram: 0 kbytes
> total ram: 2113872 kbytes
> duplicate: 452422 pages
> skipped: 0 pages
> normal: 164586 pages
> normal bytes: 658344 kbytes
> (qemu) info status
> VM status: paused (postmigrate)
> 
> 
> Additional info:
> I also test the following scenarios, migration can finish normally,
> remaining ram is 0k.
> 1). boot win8-32 guest, unhotplug 5/6 nics then do migration
> 2). boot rhel7 guest, unhotplug 4/5/6 nics then do migration

Comment 8 huiqingding 2014-06-24 02:10:34 UTC
(In reply to huiqingding from comment #6)
> Reproduce this bug using the following version:
> qemu-kvm-1.5.3-64.el7.x86_64
> kernel-3.10.0-128.el7.x86_64
> 
Correction:

Reproduce this bug using the following version:
qemu-kvm-1.5.3-60.el7_0.4.x86_64
kernel-3.10.0-128.el7.x86_64

Use the following steps, win8-32 and rhel7 guest can migration normally after hotunplug 4/5/6 nics.

> Steps to Reproduce:
> 1. boot a win8-32 guest on src host
> /usr/libexec/qemu-kvm \
> -M pc \
> -cpu SandyBridge,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff \
> -m 2G \
> -smp 4,sockets=2,cores=2,threads=1,maxcpus=16 \
> -enable-kvm \
> -name win8 \
> -uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
> -smbios type=1,manufacturer='Red Hat',product='RHEV
> Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-
> e63fcdb67170 \
> -k en-us \
> -rtc base=localtime,clock=host,driftfix=slew \
> -nodefaults \
> -monitor stdio \
> -qmp tcp:localhost:6666,server,nowait \
> -boot menu=on \
> -bios /usr/share/seabios/bios.bin \
> -vga cirrus \
> -vnc :0 \
> -drive
> file=/home/win8-32-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,
> cache=none,werror=stop,rerror=stop,aio=threads \
> -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,
> id=virtio-disk0,bootindex=0 \
> -netdev
> tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,
> ifname=guest0 \
> -device
> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:13:10:10,bus=pci.0,
> addr=0x4 \
> -netdev
> tap,id=hostnet1,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,
> ifname=guest1 \
> -device
> virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:13:10:11,bus=pci.0,
> addr=0x5 \
> -netdev
> tap,id=hostnet2,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,
> ifname=guest2 \
> -device
> virtio-net-pci,netdev=hostnet2,id=net2,mac=52:54:00:13:10:12,bus=pci.0,
> addr=0x6 \
> -netdev
> tap,id=hostnet3,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,
> ifname=guest3 \
> -device
> virtio-net-pci,netdev=hostnet3,id=net3,mac=52:54:00:13:10:13,bus=pci.0,
> addr=0x7 \
> 2. unhotplug four nics
> # telnet localhost 6666
> Trying ::1...
> Connected to localhost.
> Escape character is '^]'.
> {"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1},
> "package": " (qemu-kvm-1.5.3-60.el7)"}, "capabilities": []}}
> {"execute":"qmp_capabilities"}
> {"return": {}}
> {"execute": "device_del", "arguments": {"id": "net0"}}
> {"return": {}}
> {"timestamp": {"seconds": 1403250008, "microseconds": 416150}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/net0/virtio-backend"}}
> {"timestamp": {"seconds": 1403250008, "microseconds": 416302}, "event":
> "DEVICE_DELETED", "data": {"device": "net0", "path":
> "/machine/peripheral/net0"}}
> {"execute": "device_del", "arguments": {"id": "net1"}}
> {"return": {}}
> {"timestamp": {"seconds": 1403250012, "microseconds": 251351}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/net1/virtio-backend"}}
> {"timestamp": {"seconds": 1403250012, "microseconds": 251507}, "event":
> "DEVICE_DELETED", "data": {"device": "net1", "path":
> "/machine/peripheral/net1"}}
> {"execute": "device_del", "arguments": {"id": "net2"}}
> {"return": {}}
> {"timestamp": {"seconds": 1403250017, "microseconds": 624422}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/net2/virtio-backend"}}
> {"timestamp": {"seconds": 1403250017, "microseconds": 624588}, "event":
> "DEVICE_DELETED", "data": {"device": "net2", "path":
> "/machine/peripheral/net2"}}
> {"execute": "device_del", "arguments": {"id": "net3"}}
> {"return": {}}
> {"timestamp": {"seconds": 1403250021, "microseconds": 721016}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/net3/virtio-backend"}}
> {"timestamp": {"seconds": 1403250021, "microseconds": 721165}, "event":
> "DEVICE_DELETED", "data": {"device": "net3", "path":
> "/machine/peripheral/net3"}}
> {"execute": "netdev_del", "arguments": {"id": "hostnet0"}}
> {"return": {}}
> {"execute": "netdev_del", "arguments": {"id": "hostnet1"}}
> {"return": {}}
> {"execute": "netdev_del", "arguments": {"id": "hostnet2"}}
> {"return": {}}
> {"execute": "netdev_del", "arguments": {"id": "hostnet3"}}
> {"return": {}}
> 3. do migration 
> (qemu) migrate -d tcp:10.66.9.152:5800
> 4. check migration status in src qemu-kvm
> 
> Actual results:
> migration can finish normally, remaining ram is 0k.
> (qemu) info migrate
> capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off
> zero-blocks: off 
> Migration status: completed
> total time: 57862 milliseconds
> downtime: 32 milliseconds
> setup: 10 milliseconds
> transferred ram: 663613 kbytes
> throughput: 98.01 mbps
> remaining ram: 0 kbytes
> total ram: 2113872 kbytes
> duplicate: 452422 pages
> skipped: 0 pages
> normal: 164586 pages
> normal bytes: 658344 kbytes
> (qemu) info status
> VM status: paused (postmigrate)
> 
> 
> Additional info:
> I also test the following scenarios, migration can finish normally,
> remaining ram is 0k.
> 1). boot win8-32 guest, unhotplug 5/6 nics then do migration
> 2). boot rhel7 guest, unhotplug 4/5/6 nics then do migration

Comment 9 huiqingding 2014-06-30 02:54:12 UTC
Please ignore comment8.
The following is the verification steps.

Verify this bug using the following version:
qemu-kvm-1.5.3-60.el7_0.4.x86_64
kernel-3.10.0-128.el7.x86_64

Steps to Verify:
1. boot a win8-32 guest on src host
/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff \
-m 2G \
-smp 4,sockets=2,cores=2,threads=1,maxcpus=16 \
-enable-kvm \
-name win8 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-rtc base=localtime,clock=host,driftfix=slew \
-nodefaults \
-monitor stdio \
-qmp tcp:localhost:6666,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-vga cirrus \
-vnc :0 \
-drive file=/home/win8-32-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \
-netdev tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:13:10:10,bus=pci.0,addr=0x4 \
-netdev tap,id=hostnet1,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest1 \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:13:10:11,bus=pci.0,addr=0x5 \
-netdev tap,id=hostnet2,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest2 \
-device virtio-net-pci,netdev=hostnet2,id=net2,mac=52:54:00:13:10:12,bus=pci.0,addr=0x6 \
-netdev tap,id=hostnet3,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,ifname=guest3 \
-device virtio-net-pci,netdev=hostnet3,id=net3,mac=52:54:00:13:10:13,bus=pci.0,addr=0x7 \
2. unhotplug four nics
# telnet localhost 6666
Trying ::1...
Connected to localhost.
Escape character is '^]'.
{"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1}, "package": " (qemu-kvm-1.5.3-60.el7)"}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute": "device_del", "arguments": {"id": "net0"}}
{"return": {}}
{"timestamp": {"seconds": 1403250008, "microseconds": 416150}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net0/virtio-backend"}}
{"timestamp": {"seconds": 1403250008, "microseconds": 416302}, "event": "DEVICE_DELETED", "data": {"device": "net0", "path": "/machine/peripheral/net0"}}
{"execute": "device_del", "arguments": {"id": "net1"}}
{"return": {}}
{"timestamp": {"seconds": 1403250012, "microseconds": 251351}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net1/virtio-backend"}}
{"timestamp": {"seconds": 1403250012, "microseconds": 251507}, "event": "DEVICE_DELETED", "data": {"device": "net1", "path": "/machine/peripheral/net1"}}
{"execute": "device_del", "arguments": {"id": "net2"}}
{"return": {}}
{"timestamp": {"seconds": 1403250017, "microseconds": 624422}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net2/virtio-backend"}}
{"timestamp": {"seconds": 1403250017, "microseconds": 624588}, "event": "DEVICE_DELETED", "data": {"device": "net2", "path": "/machine/peripheral/net2"}}
{"execute": "device_del", "arguments": {"id": "net3"}}
{"return": {}}
{"timestamp": {"seconds": 1403250021, "microseconds": 721016}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/net3/virtio-backend"}}
{"timestamp": {"seconds": 1403250021, "microseconds": 721165}, "event": "DEVICE_DELETED", "data": {"device": "net3", "path": "/machine/peripheral/net3"}}
{"execute": "netdev_del", "arguments": {"id": "hostnet0"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet1"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet2"}}
{"return": {}}
{"execute": "netdev_del", "arguments": {"id": "hostnet3"}}
{"return": {}}
3. do migration 
(qemu) migrate -d tcp:10.66.9.152:5800
4. check migration status in src qemu-kvm

Actual results:
migration can finish normally, remaining ram is 0k.
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: completed
total time: 57862 milliseconds
downtime: 32 milliseconds
setup: 10 milliseconds
transferred ram: 663613 kbytes
throughput: 98.01 mbps
remaining ram: 0 kbytes
total ram: 2113872 kbytes
duplicate: 452422 pages
skipped: 0 pages
normal: 164586 pages
normal bytes: 658344 kbytes
(qemu) info status
VM status: paused (postmigrate)


Additional info:
I also test the following scenarios, migration can finish normally, remaining ram is 0k.
1). boot win8-32 guest, unhotplug 5/6 nics then do migration
2). boot rhel7 guest, unhotplug 4/5/6 nics then do migration

Comment 12 errata-xmlrpc 2014-07-23 16:18: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.

http://rhn.redhat.com/errata/RHSA-2014-0927.html