id = 1477
title = "hot-plugged interface are not working after live migration"
state = "closed"
created_at = "2023-02-08T09:19:43.697Z"
closed_at = "2023-02-10T09:45:09.188Z"
labels = []
url = "https://gitlab.com/qemu-project/qemu/-/issues/1477"
host-os = "Rocky Linux 8.6"
host-arch = "x86"
qemu-version = "QEMU emulator version 6.2.0 (qemu-kvm-6.2.0-20.module+el8.7.0+1084+97b81f61.2)"
guest-os = "centos linux 7"
guest-arch = "x86"
description = """After a live migration are perform for a vm then hot-plug interface pci didn't show up, but did found a SCSI storage controller is created. I checked libvirt did send qmp command to qemu `[pid 320011] 1673945683.378537 write(42, "{"execute":"device_add","arguments":{"driver":"virtio-net-pci","netdev":"hostua-test","id":"ua-test","mac":"00:e0:4c:6a:3b:51","bus":"pci.7","addr":"0x0"},"id":"libvirt-200"}rn", 176) = 176
`"""
reproduce = """1. Perform a live migration by issue command `virsh migrate --live --persistent --verbose --unsafe --p2p demo-vm qemu+tls://node8/system?pkipath=/etc/pki/libvirt/private/`
2. Then on the destination node that vm moved, create a bridge deivce `ip link add br-test1 type bridge`
3. Create a tap.xml file with following code
```
```
4. Save origin pci information
```
$ virsh console demo-vm
# Save origin pci information
[root@demo-vm ~]# lshw > before
```
5. Hot-plug an interface `virsh attach-device demo-vm tap.xml-backup --live --config`
6. Dumpxml of demo-vm
```
demo-vmcc74b867-3fb4-5e4f-bbce-33df21a8941679db3d82-ce8f-44e8-96a5-940cc37c006430134217728104857610485761281/machinecc74b867-3fb4-5e4f-bbce-33df21a89416hvmSkylake-Server-IBRSInteldestroyrestartdestroy/usr/libexec/qemu-kvm+107:+107
```
7. Console to vm and check pci
```
$ virsh console demo-vm
# no additional nic found in `ip a` list
[root@demo-vm ~]# ip a
# Compare pci
[root@demo-vm ~]# lshw > after
# instead of a virtio network pci i saw a virtio SCSI is created
[root@demo-vm ~]# diff before after
# output
*-scsi
description: SCSI storage controller
product: Virtio SCSI
vendor: Red Hat, Inc.
physical id: 0
bus info: pci@0000:02:00.0
version: 01
width: 64 bits
clock: 33MHz
capabilities: scsi msix pm pciexpress bus_master cap_list
configuration: driver=virtio-pci latency=0
resources: irq:22 memory:fe600000-fe600fff memory:fc400000-fc403fff
```"""
additional = """"""