PCIDeviceClass and PCIDevice are defined in pci.h. Many users of the header don't actually need them. Similar structs live in their own headers: PCIBusClass and PCIBus in pci_bus.h, PCIBridge in pci_bridge.h, PCIHostBridgeClass and PCIHostState in pci_host.h, PCIExpressHost in pcie_host.h, and PCIERootPortClass, PCIEPort, and PCIESlot in pcie_port.h. Move PCIDeviceClass and PCIDeviceClass to new pci_device.h, along with the code that needs them. Adjust include directives. This also enables the next commit. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20221222100330.380143-6-armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * Copyright © 2018, 2021 Oracle and/or its affiliates.
 | 
						|
 *
 | 
						|
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
						|
 * See the COPYING file in the top-level directory.
 | 
						|
 *
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef PROXY_H
 | 
						|
#define PROXY_H
 | 
						|
 | 
						|
#include "hw/pci/pci_device.h"
 | 
						|
#include "io/channel.h"
 | 
						|
#include "hw/remote/proxy-memory-listener.h"
 | 
						|
#include "qemu/event_notifier.h"
 | 
						|
 | 
						|
#define TYPE_PCI_PROXY_DEV "x-pci-proxy-dev"
 | 
						|
OBJECT_DECLARE_SIMPLE_TYPE(PCIProxyDev, PCI_PROXY_DEV)
 | 
						|
 | 
						|
typedef struct ProxyMemoryRegion {
 | 
						|
    PCIProxyDev *dev;
 | 
						|
    MemoryRegion mr;
 | 
						|
    bool memory;
 | 
						|
    bool present;
 | 
						|
    uint8_t type;
 | 
						|
} ProxyMemoryRegion;
 | 
						|
 | 
						|
struct PCIProxyDev {
 | 
						|
    PCIDevice parent_dev;
 | 
						|
    char *fd;
 | 
						|
 | 
						|
    /*
 | 
						|
     * Mutex used to protect the QIOChannel fd from
 | 
						|
     * the concurrent access by the VCPUs since proxy
 | 
						|
     * blocks while awaiting for the replies from the
 | 
						|
     * process remote.
 | 
						|
     */
 | 
						|
    QemuMutex io_mutex;
 | 
						|
    QIOChannel *ioc;
 | 
						|
    Error *migration_blocker;
 | 
						|
    ProxyMemoryListener proxy_listener;
 | 
						|
    int virq;
 | 
						|
    EventNotifier intr;
 | 
						|
    EventNotifier resample;
 | 
						|
    ProxyMemoryRegion region[PCI_NUM_REGIONS];
 | 
						|
};
 | 
						|
 | 
						|
#endif /* PROXY_H */
 |