/proc/v3vee/v3-mem will now report correctly after memory has been onlined
13 -- (VMM) Free VM
50 -- (VMM) Add physical memory to VMM manager
+51 -- (VMM) Reset VMM manager memory counts
55 -- (IFACE) Add PCI HW Device
56 -- (IFACE) Add PCI User Device
break;
}
+ case V3_RESET_MEMORY: {
+ if (palacios_init_mm() == -1) {
+ ERROR("Error resetting Palacios memory\n");
+ return -EFAULT;
+ }
+ break;
+ }
default: {
struct global_ctrl * ctrl = get_global_ctrl(ioctl);
#define V3_FREE_GUEST 13
#define V3_ADD_MEMORY 50
+#define V3_RESET_MEMORY 51
+
#define V3_ADD_PCI_HW_DEV 55
#define V3_ADD_PCI_USER_DEV 56
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+
+#include "v3_ctrl.h"
int main(void)
{
unsigned long amount_allocated = 0;
unsigned long long block_size = 0;
int i = 0;
+ int v3_fd;
fp = fopen(filepath, "r");
if(fp == NULL) {
base_addr++;
}
+ v3_fd = open(v3_dev, O_RDONLY);
+ if (v3_fd == -1) {
+ printf("Error opening V3Vee control device\n");
+ return -1;
+ }
+
+ ioctl(v3_fd, V3_RESET_MEMORY, NULL);
+ close(v3_fd);
+
return 0;
}