-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (32 loc) · 923 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from bitmap import Bitmap
from incremental import Incremental
from rebase import Rebase
from full import Full
import sys
def info():
print(
"QEMU-BACKUP accepts these actions:"
"\n\n- python3 main.py bitmap <VM_NAME>"
"\n- python3 main.py full <VM_NAME>"
"\n- python3 main.py inc <VM_NAME>"
"\n- python3 main.py rebase <VM_NAME>"
"\n\nFor more information about this project, see github repository https://github.com/matteo-39/qemu-backup"
)
exit(1)
if __name__ == '__main__':
if len(sys.argv) != 3:
info()
action = sys.argv[1]
vm_name = sys.argv[2]
obj = None
if action == 'bitmap':
obj = Bitmap(vm_name)
elif action == 'full':
obj = Full(vm_name)
elif action == 'inc':
obj = Incremental(vm_name)
elif action == 'rebase':
obj = Rebase(vm_name)
else:
info()
obj.run()