Parent Directory | Revision Log
add a type to be able to manage storage directory for libvirtd
1 | #!/usr/bin/python |
2 | import libvirt |
3 | import sys |
4 | |
5 | name = sys.argv[1] |
6 | path = sys.argv[2] |
7 | |
8 | storage_xml = """ |
9 | <pool type='dir'> |
10 | <name>%s</name> |
11 | <capacity>0</capacity> |
12 | <allocation>0</allocation> |
13 | <available>0</available> |
14 | <source> |
15 | </source> |
16 | <target> |
17 | <path>%s</path> |
18 | <permissions> |
19 | <mode>0700</mode> |
20 | <owner>-1</owner> |
21 | <group>-1</group> |
22 | </permissions> |
23 | </target> |
24 | </pool>""" % ( name, path ) |
25 | |
26 | c=libvirt.open("qemu:///system") |
27 | c.storagePoolCreateXML(storage_xml,0) |
28 |
ViewVC Help | |
Powered by ViewVC 1.1.30 |