2008-12-04 23:33:06 +03:00
|
|
|
/*
|
|
|
|
* Virtio Support
|
|
|
|
*
|
|
|
|
* Copyright IBM, Corp. 2007-2008
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
|
|
|
* Rusty Russell <rusty@rustcorp.com.au>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2. See
|
|
|
|
* the COPYING file in the top-level directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _QEMU_VIRTIO_BALLOON_H
|
|
|
|
#define _QEMU_VIRTIO_BALLOON_H
|
|
|
|
|
2015-02-17 00:35:52 +03:00
|
|
|
#include "standard-headers/linux/virtio_balloon.h"
|
2013-02-05 20:06:20 +04:00
|
|
|
#include "hw/virtio/virtio.h"
|
2013-02-04 18:40:22 +04:00
|
|
|
#include "hw/pci/pci.h"
|
2008-12-04 23:33:06 +03:00
|
|
|
|
2013-04-09 14:04:48 +04:00
|
|
|
#define TYPE_VIRTIO_BALLOON "virtio-balloon-device"
|
2013-03-27 13:49:10 +04:00
|
|
|
#define VIRTIO_BALLOON(obj) \
|
|
|
|
OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON)
|
|
|
|
|
2015-02-17 00:35:52 +03:00
|
|
|
typedef struct virtio_balloon_stat VirtIOBalloonStat;
|
2010-01-26 23:17:35 +03:00
|
|
|
|
2015-06-04 13:34:31 +03:00
|
|
|
typedef struct virtio_balloon_stat_modern {
|
|
|
|
uint16_t tag;
|
|
|
|
uint8_t reserved[6];
|
|
|
|
uint64_t val;
|
|
|
|
} VirtIOBalloonStatModern;
|
|
|
|
|
2013-03-18 20:37:18 +04:00
|
|
|
typedef struct VirtIOBalloon {
|
2013-03-27 13:49:14 +04:00
|
|
|
VirtIODevice parent_obj;
|
2013-03-18 20:37:18 +04:00
|
|
|
VirtQueue *ivq, *dvq, *svq;
|
|
|
|
uint32_t num_pages;
|
|
|
|
uint32_t actual;
|
|
|
|
uint64_t stats[VIRTIO_BALLOON_S_NR];
|
2016-02-04 17:26:51 +03:00
|
|
|
VirtQueueElement *stats_vq_elem;
|
2013-03-18 20:37:18 +04:00
|
|
|
size_t stats_vq_offset;
|
|
|
|
QEMUTimer *stats_timer;
|
|
|
|
int64_t stats_last_update;
|
|
|
|
int64_t stats_poll_interval;
|
2015-06-15 13:52:52 +03:00
|
|
|
uint32_t host_features;
|
2013-03-18 20:37:18 +04:00
|
|
|
} VirtIOBalloon;
|
|
|
|
|
2008-12-04 23:33:06 +03:00
|
|
|
#endif
|