One Hat Cyber Team
Your IP :
216.73.216.14
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
python3-libvirt
/
examples
/
View File Name :
domrestore.py
#!/usr/bin/env python3 """ Restore all the domains contained in DIR. It is assumed that all files in DIR are images of domU's previously created with save. """ import libvirt import os from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("dir") args = parser.parse_args() imgs = os.listdir(args.dir) try: conn = libvirt.open(None) except libvirt.libvirtError: print('Failed to open connection to the hypervisor') exit(1) for img in imgs: file = os.path.join(args.dir, img) print("Restoring %s ... " % img) ret = conn.restore(file) if ret == 0: print("done") else: print("error %d" % ret)