summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Hicks <mhicks@localhost.localdomain>2008-07-17 18:24:54 -0400
committerMatt Hicks <mhicks@localhost.localdomain>2008-07-17 18:24:54 -0400
commit525cfba36ef76ec282a88ee0251990d2802c5fe0 (patch)
tree3a5737b811d8ccae2b0460a7b3dd68bf4386bdce
parent434f2ea877b95486b59047bd6fa63fba69b2fdfd (diff)
downloadthird_party-func-525cfba36ef76ec282a88ee0251990d2802c5fe0.tar.gz
third_party-func-525cfba36ef76ec282a88ee0251990d2802c5fe0.tar.xz
third_party-func-525cfba36ef76ec282a88ee0251990d2802c5fe0.zip
Switching from using 'virsh autostart' to manually creating
the autostart link to allow for the autostart to work even when the VM is not running.
-rw-r--r--func/minion/modules/virt.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/func/minion/modules/virt.py b/func/minion/modules/virt.py
index e6a896a..6cf8c31 100644
--- a/func/minion/modules/virt.py
+++ b/func/minion/modules/virt.py
@@ -197,10 +197,13 @@ class Virt(func_module.FuncModule):
"/etc/xen/auto"
]
else:
- autostart_args = [
- "/usr/bin/virsh",
- "autostart",
- vm
+ # We aren't using virsh autostart because we want
+ # the command to work even when the VM isn't running
+ autostart_args = [
+ "/bin/ln",
+ "-s",
+ "/etc/libvirt/qemu/%s.xml" % vm,
+ "/etc/libvirt/qemu/autostart/%s.xml" % vm
]
return sub_process.call(autostart_args,shell=False,close_fds=True)