2
0

proxy.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_device.h"
  11. #include "io/channel.h"
  12. #include "hw/remote/proxy-memory-listener.h"
  13. #include "qemu/event_notifier.h"
  14. #define TYPE_PCI_PROXY_DEV "x-pci-proxy-dev"
  15. OBJECT_DECLARE_SIMPLE_TYPE(PCIProxyDev, PCI_PROXY_DEV)
  16. typedef struct ProxyMemoryRegion {
  17. PCIProxyDev *dev;
  18. MemoryRegion mr;
  19. bool memory;
  20. bool present;
  21. uint8_t type;
  22. } ProxyMemoryRegion;
  23. struct PCIProxyDev {
  24. PCIDevice parent_dev;
  25. char *fd;
  26. /*
  27. * Mutex used to protect the QIOChannel fd from
  28. * the concurrent access by the VCPUs since proxy
  29. * blocks while awaiting for the replies from the
  30. * process remote.
  31. */
  32. QemuMutex io_mutex;
  33. QIOChannel *ioc;
  34. Error *migration_blocker;
  35. ProxyMemoryListener proxy_listener;
  36. int virq;
  37. EventNotifier intr;
  38. EventNotifier resample;
  39. ProxyMemoryRegion region[PCI_NUM_REGIONS];
  40. };
  41. #endif /* PROXY_H */