pci: implement power state
commit23786d13441d36e0efcfee94ba8ff218746bed6c
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 11 Nov 2021 13:08:54 +0000 (11 14:08 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 15 Nov 2021 16:10:11 +0000 (15 11:10 -0500)
tree7e218be335b04fe0cf0f9b4e8bb726431ae0dc4f
parentc829540401f280f0cad24131f4e7b92e81d506fa
pci: implement power state

This allows to power off pci devices.  In "off" state the devices will
not be visible.  No pci config space access, no pci bar access, no dma.

Default state is "on", so this patch (alone) should not change behavior.

Use case:  Allows hotplug controllers implement slot power.  Hotplug
controllers doing so should set the inital power state for devices in
the ->plug callback.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20211111130859.1171890-2-kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci.c
hw/pci/pci_host.c
include/hw/pci/pci.h