-
-
Save anonymous/01ac69ff3d5585052102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.LibVirt | |
import Control.Monad | |
main = do | |
c <- openConnection "qemu:///system" | |
putStrLn "opened connection" | |
void $ defineDomainXML c xml | |
putStrLn "defined domain" | |
void $ closeConnection c | |
putStrLn "closed connection" | |
xml = "<domain type=\"qemu\">\ | |
\ <name>TEST-03</name>\ | |
\ <title>test from wiki</title>\ | |
\ <vcpu>1</vcpu>\ | |
\ <memory unit='KiB'>83886</memory>\ | |
\ <os>\ | |
\ <type arch=\"x86_64\">hvm</type>\ | |
\ </os>\ | |
\ <clock sync=\"localtime\"/>\ | |
\ <devices>\ | |
\ <emulator>/usr/bin/qemu-system-x86_64</emulator>\ | |
\ <disk type=\"file\" device=\"disk\">\ | |
\ <source file=\"/var/lib/vm-mon/domains/TEST-03/IMAGE\"/>\ | |
\ <target dev=\"hda\"/>\ | |
\ </disk>\ | |
\ </devices>\ | |
\</domain>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
C - no errors: