[PATCH 2/2] kvm.write: Set VM to autostart if specified

Jonathan Maw jonathan.maw at codethink.co.uk
Mon Jun 3 18:03:14 BST 2013


---
 morphlib/exts/kvm.write |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/morphlib/exts/kvm.write b/morphlib/exts/kvm.write
index 4bfff8c..f2683d8 100755
--- a/morphlib/exts/kvm.write
+++ b/morphlib/exts/kvm.write
@@ -115,6 +115,9 @@ class KvmPlusSshWriteExtension(morphlib.writeexts.WriteExtension):
             cmdline += ['--noreboot']
         cliapp.ssh_runcmd(ssh_host, cmdline)
 
+        if autostart:
+            cliapp.ssh_runcmd(ssh_host,
+                ['virsh', '--connect', 'qemu:///system', 'autostart', vm_name])
 
 KvmPlusSshWriteExtension().run()
 
-- 
1.7.10.4




More information about the baserock-dev mailing list