virtio_balloon.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _LINUX_VIRTIO_BALLOON_H
  2. #define _LINUX_VIRTIO_BALLOON_H
  3. /* This header is BSD licensed so anyone can use the definitions to implement
  4. * compatible drivers/servers. */
  5. #include <linux/virtio_ids.h>
  6. #include <linux/virtio_config.h>
  7. /* The feature bitmap for virtio balloon */
  8. #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */
  9. #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */
  10. /* Size of a PFN in the balloon interface. */
  11. #define VIRTIO_BALLOON_PFN_SHIFT 12
  12. struct virtio_balloon_config
  13. {
  14. /* Number of pages host wants Guest to give up. */
  15. __le32 num_pages;
  16. /* Number of pages we've actually got in balloon. */
  17. __le32 actual;
  18. };
  19. #define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */
  20. #define VIRTIO_BALLOON_S_SWAP_OUT 1 /* Amount of memory swapped out */
  21. #define VIRTIO_BALLOON_S_MAJFLT 2 /* Number of major faults */
  22. #define VIRTIO_BALLOON_S_MINFLT 3 /* Number of minor faults */
  23. #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */
  24. #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */
  25. #define VIRTIO_BALLOON_S_NR 6
  26. struct virtio_balloon_stat {
  27. u16 tag;
  28. u64 val;
  29. } __attribute__((packed));
  30. #endif /* _LINUX_VIRTIO_BALLOON_H */