-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dorian Eikenberg
committed
Jan 8, 2020
1 parent
5dcd7d8
commit ac11fe4
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <stdio.h> | ||
#include "libmicrovmi.h" | ||
|
||
void pause(MicrovmiContext* driver) { | ||
if (microvmi_pause(driver) == MicrovmiSuccess) { | ||
printf("Paused.\n"); | ||
} else { | ||
printf("Unable to pause VM.\n"); | ||
return; | ||
} | ||
if (microvmi_resume(driver) == MicrovmiSuccess) { | ||
printf("Resumed.\n"); | ||
} else { | ||
printf("Unable to resume VM.\n"); | ||
} | ||
} | ||
|
||
int main(int argc, char* argv[]) { | ||
if (argc < 2) { | ||
printf("No domain name given.\n"); | ||
return 1; | ||
} | ||
MicrovmiContext* driver = microvmi_init(argv[1], Xen); | ||
pause(driver); | ||
microvmi_destroy(driver); | ||
return 0; | ||
} |