From 5d5a3a39efe043dd49897f087528d6e03e5893e5 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 29 Mar 2011 22:47:59 +0000 Subject: add a type to be able to manage storage directory for libvirtd --- modules/libvirtd/files/storage_add.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 modules/libvirtd/files/storage_add.py (limited to 'modules/libvirtd/files/storage_add.py') diff --git a/modules/libvirtd/files/storage_add.py b/modules/libvirtd/files/storage_add.py new file mode 100644 index 00000000..88475ec6 --- /dev/null +++ b/modules/libvirtd/files/storage_add.py @@ -0,0 +1,28 @@ +#!/usr/bin/python +import libvirt +import sys + +name = sys.argv[1] +path = sys.argv[2] + +storage_xml = """ + + %s + 0 + 0 + 0 + + + + %s + + 0700 + -1 + -1 + + +""" % ( name, path ) + +c=libvirt.open("qemu:///system") +c.storagePoolCreateXML(storage_xml,0) + -- cgit v1.2.1