#!/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.storagePoolDefineXML(storage_xml,0)