pcie_sriov: Do not manually unrealize
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Thu, 16 Jan 2025 09:00:57 +0000 (18:00 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 20 Feb 2025 23:23:19 +0000 (18:23 -0500)
A device gets automatically unrealized when being unparented.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20250116-reuse-v20-6-7cb370606368@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/pci/pcie_sriov.c

index e9b23221d713c0802c2fd91f83eb925a68031c2c..499becd5273f8423e05813379b04645d459cfa91 100644 (file)
@@ -204,11 +204,7 @@ static void unregister_vfs(PCIDevice *dev)
     trace_sriov_unregister_vfs(dev->name, PCI_SLOT(dev->devfn),
                                PCI_FUNC(dev->devfn), num_vfs);
     for (i = 0; i < num_vfs; i++) {
-        Error *err = NULL;
         PCIDevice *vf = dev->exp.sriov_pf.vf[i];
-        if (!object_property_set_bool(OBJECT(vf), "realized", false, &err)) {
-            error_reportf_err(err, "Failed to unplug: ");
-        }
         object_unparent(OBJECT(vf));
         object_unref(OBJECT(vf));
     }