core-admin/dom0/restore/xenfreepages.c
Rafal Wojtczuk 4cf0a61858 Before restoring DVM, check for available xen memory
As we already do xm mem-set 0 800 in qubes_core, this is a
correct check. Now, there should be no errors from qubes_restore
in normal circumstances.
2010-07-27 16:08:09 +02:00

19 lines
339 B
C

#include <xenctrl.h>
#include <stdio.h>
#include <stdlib.h>
struct xen_sysctl_physinfo xphysinfo;
main()
{
int handle = xc_interface_open();
if (handle == -1) {
perror("xc_interface_open");
exit(1);
}
if (xc_physinfo(handle, &xphysinfo)) {
perror("xc_physinfo");
exit(1);
}
printf("%lld", xphysinfo.free_pages);
return 0;
}