virtual: 0.884 peripherals: 0.882 graphic: 0.831 performance: 0.794 hypervisor: 0.762 x86: 0.756 VMM: 0.742 i386: 0.699 architecture: 0.694 vnc: 0.676 debug: 0.669 socket: 0.662 device: 0.637 PID: 0.628 user-level: 0.568 kernel: 0.501 ppc: 0.497 KVM: 0.473 semantic: 0.468 mistranslation: 0.431 boot: 0.430 network: 0.405 risc-v: 0.381 files: 0.379 TCG: 0.348 register: 0.333 permissions: 0.298 arm: 0.250 assembly: 0.233 Migration fails with 'get_pci_config_device: Bad config data: i=0x9a read: 2 device: 3 cmask: ff wmask: 0 w1cmask:0' after hotplugging a CPU Description of problem: After hotplugging a CPU and finishing a migration from node 1 to node 2, the instance on node 2 crashes when virtio block devices are used: ``` qemu-system-x86_64: get_pci_config_device: Bad config data: i=0x9a read: 2 device: 3 cmask: ff wmask: 0 w1cmask:0 qemu-system-x86_64: Failed to load PCIDevice:config qemu-system-x86_64: Failed to load virtio-blk:virtio qemu-system-x86_64: error while loading state for instance 0x0 of device '0000:00:04.0/virtio-blk' qemu-system-x86_64: load of migration failed: Invalid argument ``` I found the problem also exhibits when using `scsi-hd` in combination with `virtio-scsi`, but not when using IDE hard disks or SCSI disks with an LSI controller. VMs with network cards aren't affected either, as are VMs without virtio disks. Interestingly, the latest QEMU version shipped with Ubuntu 20.04 (4.2.1-Debian 1:4.2-3ubuntu6.29) is able to migrate this VM just fine. Steps to reproduce: 1. Start a VM using the first command line 2. Start another VM using the second command line 3. Hotplug a CPU in QMP: ``` {"execute":"device_add","arguments":{"node-id":0,"socket-id":0,"core-id":2,"thread-id":0,"id":{},"driver":"qemu64-x86_64-cpu"}} ``` 4. Start a migration by executing the following QMP command (again substituting `` with the IP:port combination of node 2 ``` {"execute":"migrate","arguments":{"uri":"tcp:127.0.0.1:1234"}} ``` (For steps 3 and 4 I used this): ``` echo '{"execute":"qmp_capabilities"} {"execute":"device_add","arguments":{"node-id":0,"socket-id":0,"core-id":2,"thread-id":0,"id":{},"driver":"qemu64-x86_64-cpu"},"id":1} {"execute":"migrate","arguments":{"uri":"tcp:127.0.0.1:1234"},"id":2}' | nc -U /tmp/vm1.sock ``` Additional information: