KVM
|
#include <linux/kvm_host.h>
#include <linux/kvm.h>
#include <linux/errno.h>
#include <linux/uaccess.h>
Go to the source code of this file.
Functions | |
ssize_t | kvm_stats_read (char *id, const struct kvm_stats_header *header, const struct _kvm_stats_desc *desc, void *stats, size_t size_stats, char __user *user_buffer, size_t size, loff_t *offset) |
ssize_t kvm_stats_read | ( | char * | id, |
const struct kvm_stats_header * | header, | ||
const struct _kvm_stats_desc * | desc, | ||
void * | stats, | ||
size_t | size_stats, | ||
char __user * | user_buffer, | ||
size_t | size, | ||
loff_t * | offset | ||
) |
kvm_stats_read() - Common function to read from the binary statistics file descriptor.
@id: identification string of the stats @header: stats header for a vm or a vcpu @desc: start address of an array of stats descriptors for a vm or a vcpu @stats: start address of stats data block for a vm or a vcpu @size_stats: the size of stats data block pointed by @stats @user_buffer: start address of userspace buffer @size: requested read size from userspace @offset: the start position from which the content will be read for the corresponding vm or vcp file descriptor
The file content of a vm/vcpu file descriptor is now defined as below: +----------—+ | Header | +----------—+ | id string | +----------—+ | Descriptors | +----------—+ | Stats Data | +----------—+ Although this function allows userspace to read any amount of data (as long as in the limit) from any position, the typical usage would follow below steps:
Return: the number of bytes that has been successfully read
Definition at line 52 of file binary_stats.c.