2 # domstart - make sure a given domU is running, if not start it
11 print 'Usage: %s DIR' % sys
.argv
[0]
12 print ' Restore all the domains contained in DIR'
13 print ' It is assumed that all files in DIR are'
14 print ' images of domU\'s previously created with save'
16 if len(sys
.argv
) != 2:
21 imgs
= os
.listdir(dir)
23 conn
= libvirt
.open(None)
25 print 'Failed to open connection to the hypervisor'
29 file = os
.path
.join(dir, img
)
30 print "Restoring %s ... " % img
,
32 ret
= conn
.restore(file)
36 print "error %d" % ret