* Only stop libvirt-guests automatically on system shutdown.

Saving/restoring VMs is disruptive.

svn path=/nixos/trunk/; revision=33844
This commit is contained in:
Eelco Dolstra 2012-04-19 15:12:55 +00:00
parent 0cb5673400
commit 43f43fd185

View File

@ -53,6 +53,7 @@ in
{ description = "Libvirtd virtual machine management daemon";
startOn = "stopped udevtrigger";
stopOn = "";
path =
[ pkgs.bridge_utils pkgs.dmidecode pkgs.dnsmasq
@ -98,16 +99,15 @@ in
};
# !!! Split this into save and restore tasks.
jobs.libvirt_guests =
{ name = "libvirt-guests";
description = "Job to save/restore libvirtd VMs";
jobs."libvirt-guests" =
{ description = "Job to save/restore libvirtd VMs";
startOn = "started libvirtd";
# We want to suspend VMs only on shutdown, but Upstart is broken.
#stopOn = "starting shutdown and stopping libvirtd";
stopOn = "stopping libvirtd";
stopOn = "";
restartIfChanged = false;
path = [ pkgs.gettext pkgs.libvirt pkgs.gawk ];
@ -122,6 +122,18 @@ in
respawn = false;
};
jobs."stop-libvirt" =
{ description = "Helper task to stop libvirtd and libvirt-guests on shutdown";
task = true;
restartIfChanged = false;
startOn = "starting shutdown";
script =
''
stop libvirt-guests || true
stop libvirtd || true
'';
};
};
}