2
0

proxy.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright © 2018, 2021 Oracle and/or its affiliates.
  3. *
  4. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  5. * See the COPYING file in the top-level directory.
  6. *
  7. */
  8. #ifndef PROXY_H
  9. #define PROXY_H
  10. #include "hw/pci/pci.h"
  11. #include "io/channel.h"
  12. #include "hw/remote/proxy-memory-listener.h"
  13. #define TYPE_PCI_PROXY_DEV "x-pci-proxy-dev"
  14. OBJECT_DECLARE_SIMPLE_TYPE(PCIProxyDev, PCI_PROXY_DEV)
  15. typedef struct ProxyMemoryRegion {
  16. PCIProxyDev *dev;
  17. MemoryRegion mr;
  18. bool memory;
  19. bool present;
  20. uint8_t type;
  21. } ProxyMemoryRegion;
  22. struct PCIProxyDev {
  23. PCIDevice parent_dev;
  24. char *fd;
  25. /*
  26. * Mutex used to protect the QIOChannel fd from
  27. * the concurrent access by the VCPUs since proxy
  28. * blocks while awaiting for the replies from the
  29. * process remote.
  30. */
  31. QemuMutex io_mutex;
  32. QIOChannel *ioc;
  33. Error *migration_blocker;
  34. ProxyMemoryListener proxy_listener;
  35. ProxyMemoryRegion region[PCI_NUM_REGIONS];
  36. };
  37. #endif /* PROXY_H */