mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Merge pull request #555 from infernix/autostart
Support libvirt autostart functionality
This commit is contained in:
commit
ea3491b3d1
@ -216,6 +216,7 @@ end
|
||||
* `tpm_model` - The model of the TPM to which you wish to connect.
|
||||
* `tpm_type` - The type of TPM device to which you are connecting.
|
||||
* `tpm_path` - The path to the TPM device on the host system.
|
||||
* `autostart` - Automatically start the domain when the host boots. Defaults to 'false'.
|
||||
|
||||
|
||||
Specific domain settings can be set for each domain separately in multi-VM
|
||||
|
@ -208,6 +208,8 @@ module VagrantPlugins
|
||||
rescue => e
|
||||
env[:ui].error("Error when updating domain settings: #{e.message}")
|
||||
end
|
||||
# Autostart with host if enabled in Vagrantfile
|
||||
libvirt_domain.autostart = config.autostart
|
||||
# Actually start the domain
|
||||
domain.start
|
||||
rescue => e
|
||||
|
@ -108,6 +108,9 @@ module VagrantPlugins
|
||||
# Suspend mode
|
||||
attr_accessor :suspend_mode
|
||||
|
||||
# Autostart
|
||||
attr_accessor :autostart
|
||||
|
||||
def initialize
|
||||
@uri = UNSET_VALUE
|
||||
@driver = UNSET_VALUE
|
||||
@ -174,6 +177,9 @@ module VagrantPlugins
|
||||
|
||||
# Suspend mode
|
||||
@suspend_mode = UNSET_VALUE
|
||||
|
||||
# Autostart
|
||||
@autostart = UNSET_VALUE
|
||||
end
|
||||
|
||||
def boot(device)
|
||||
@ -456,6 +462,8 @@ module VagrantPlugins
|
||||
# Suspend mode
|
||||
@suspend_mode = "pause" if @suspend_mode == UNSET_VALUE
|
||||
|
||||
# Autostart
|
||||
@autostart = false if @autostart == UNSET_VALUE
|
||||
end
|
||||
|
||||
def validate(machine)
|
||||
|
Loading…
Reference in New Issue
Block a user