summary refs log tree commit diff stats
path: root/hw/pci/pcie_sriov.c
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2024-06-27 15:07:58 +0900
committerMichael S. Tsirkin <mst@redhat.com>2024-07-03 18:14:07 -0400
commit107a64b9a360cf5ca046852bc03334f7a9f22aef (patch)
tree11a8ae4f1e7c2755938e7adf3746bfb35f154705 /hw/pci/pcie_sriov.c
parentcbd9e5120bac3e292eee77b7a2e3692f235a1a26 (diff)
downloadfocaccia-qemu-107a64b9a360cf5ca046852bc03334f7a9f22aef.tar.gz
focaccia-qemu-107a64b9a360cf5ca046852bc03334f7a9f22aef.zip
pcie_sriov: Register VFs after migration
pcie_sriov doesn't have code to restore its state after migration, but
igb, which uses pcie_sriov, naively claimed its migration capability.

Add code to register VFs after migration and fix igb migration.

Fixes: 3a977deebe6b ("Intrdocue igb device emulation")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20240627-reuse-v10-9-7ca0b8ed3d9f@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/pcie_sriov.c')
-rw-r--r--hw/pci/pcie_sriov.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c
index fae6acea4a..56523ab4e8 100644
--- a/hw/pci/pcie_sriov.c
+++ b/hw/pci/pcie_sriov.c
@@ -252,6 +252,13 @@ void pcie_sriov_config_write(PCIDevice *dev, uint32_t address,
     }
 }
 
+void pcie_sriov_pf_post_load(PCIDevice *dev)
+{
+    if (dev->exp.sriov_cap) {
+        register_vfs(dev);
+    }
+}
+
 
 /* Reset SR/IOV */
 void pcie_sriov_pf_reset(PCIDevice *dev)