diff --git a/test.py b/test.py deleted file mode 100755 index f5d5c6c..0000000 --- a/test.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -import libvirt -import sys - -# Open libvirt connection (local) -connection = libvirt.open(None) - -# XML sample for testing -xml_sample = ''' -<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> - <name>one-2273</name> - <vcpu>1</vcpu> - <cputune> - <shares>512</shares> - </cputune> - <memory>1048576</memory> - <os> - <type arch='x86_64'>hvm</type> - <boot dev='hd'/> - </os> - <devices> - <emulator>/usr/bin/kvm</emulator> - <disk type='file' device='disk'> - <source file='/datastore/0/2273/disk.0'/> - <target dev='vda'/> - <driver name='qemu' type='qcow2' cache='default'/> - </disk> - <disk type='file' device='cdrom'> - <source file='/datastore/0/2273/disk.1'/> - <target dev='hda'/> - <readonly/> - <driver name='qemu' type='raw'/> - </disk> - <interface type='bridge'> - <source bridge='cloud'/> - <mac address='02:00:0a:09:01:2d'/> - <model type='virtio'/> - </interface> - <graphics type='vnc' listen='0.0.0.0' - port='8173' passwd='usxdfmnkfk'/> - </devices> - <features> - <acpi/> - </features> - <cpu><topology sockets='1' cores='1' threads='1'/></cpu> -</domain> -''' - -if connection is None: - print "Fail to connect to libvirt daemon." - sys.exit(1) -try: - names = connection.listDefinedDomains() - print names - connection.defineXML(xml_sample) - print connection.listDefinedDomains() -# conn.undefineXML() -except: - print "error" diff --git a/xmltest.py b/xmltest.py deleted file mode 100755 index 70c05d2..0000000 --- a/xmltest.py +++ /dev/null @@ -1,15 +0,0 @@ -import xml.etree.ElementTree as ET - - - -top = ET.Element('domain',attrib={'type':'kvm', 'xmlns:qemu':'http://libvirt.org/schemas/domain/qemu/1.0'}) -cpu = ET.SubElement(top,'cpu') -#vcpu = -#cputune = - -#devices = - -xml_dump = ET.tostring(top) - -print xml_dump -