diff --git a/docs/configuration.markdown b/docs/configuration.markdown
index b1390dd..2307153 100644
--- a/docs/configuration.markdown
+++ b/docs/configuration.markdown
@@ -88,6 +88,11 @@ end
set, which should be fine for paravirtualized guests, but some fully
virtualized guests may require hda. NOTE: this option also applies only to
disks associated with a box image.
+* `disk_address_type` - The address type of disk device to emulate.
+ Libvirt uses a sensible default if not set, but some fully virtualized guests
+ may need to override this (e.g. Debian on _virt_ machine may need _virtio-mmio_).
+ Possible values are documented in libvirt's [description for
+ _address_](https://libvirt.org/formatdomain.html#elementsAddress).
* `disk_driver` - Extra options for the main disk driver ([see Libvirt documentation](http://libvirt.org/formatdomain.html#elementsDisks)).
NOTE: this option also applies only to disks associated with a box image. In all cases, the value `nil` can be used to force the hypervisor default behaviour (e.g. to override settings defined in top-level Vagrantfiles). Supported options include:
* `:cache` - Controls the cache mechanism. Possible values are "default", "none", "writethrough", "writeback", "directsync" and "unsafe".
@@ -96,6 +101,7 @@ end
* `:discard` - Controls whether discard requests (also known as "trim" or "unmap") are ignored or passed to the filesystem. Possible values are "unmap" or "ignore".
Note: for discard to work, you will likely also need to set `disk_bus = 'scsi'`
* `:detect_zeroes` - Controls whether to detect zero write requests. The value can be "off", "on" or "unmap".
+ * `address_type` - Address type of disk device to emulate. If unspecified, Libvirt uses a sensible default.
* `nic_model_type` - parameter specifies the model of the network adapter when
you create a domain value by default virtio KVM believe possible values, see
the [documentation for
diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb
index fc102f6..7b0d4cc 100644
--- a/lib/vagrant-libvirt/action/create_domain.rb
+++ b/lib/vagrant-libvirt/action/create_domain.rb
@@ -50,6 +50,7 @@ module VagrantPlugins
@machine_arch = config.machine_arch
@disk_controller_model = config.disk_controller_model
@disk_driver_opts = config.disk_driver_opts
+ @disk_address_type = config.disk_address_type
@nested = config.nested
@memory_size = config.memory.to_i * 1024
@memory_backing = config.memory_backing
diff --git a/lib/vagrant-libvirt/action/resolve_disk_settings.rb b/lib/vagrant-libvirt/action/resolve_disk_settings.rb
index 2726995..f1a3f67 100644
--- a/lib/vagrant-libvirt/action/resolve_disk_settings.rb
+++ b/lib/vagrant-libvirt/action/resolve_disk_settings.rb
@@ -23,6 +23,7 @@ module VagrantPlugins
domain_name = env[:domain_name] # only set on create
disk_bus = config.disk_bus
disk_device = config.disk_device
+ disk_address_type = config.disk_address_type
domain_volume_cache = config.volume_cache || 'default'
# Storage
@@ -84,6 +85,7 @@ module VagrantPlugins
device: env[:box_volumes][index][:device],
cache: domain_volume_cache,
bus: disk_bus,
+ address_type: disk_address_type,
absolute_path: domain_volume.path,
virtual_size: env[:box_volumes][index][:virtual_size],
pool: pool_name,
diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb
index 402e57b..08aac8d 100644
--- a/lib/vagrant-libvirt/config.rb
+++ b/lib/vagrant-libvirt/config.rb
@@ -107,6 +107,7 @@ module VagrantPlugins
attr_accessor :machine_virtual_size
attr_accessor :disk_bus
attr_accessor :disk_device
+ attr_accessor :disk_address_type
attr_accessor :disk_controller_model
attr_accessor :disk_driver_opts
attr_accessor :nic_model_type
@@ -281,6 +282,7 @@ module VagrantPlugins
@machine_virtual_size = UNSET_VALUE
@disk_bus = UNSET_VALUE
@disk_device = UNSET_VALUE
+ @disk_address_type = UNSET_VALUE
@disk_controller_model = UNSET_VALUE
@disk_driver_opts = {}
@nic_model_type = UNSET_VALUE
@@ -794,6 +796,7 @@ module VagrantPlugins
disk = {
device: options[:device],
type: options[:type],
+ address_type: options[:address_type],
size: options[:size],
path: options[:path],
bus: options[:bus],
@@ -1006,6 +1009,7 @@ module VagrantPlugins
@disk_controller_model = nil
end
end
+ @disk_address_type = nil if @disk_address_type == UNSET_VALUE
@disk_driver_opts = {} if @disk_driver_opts == UNSET_VALUE
@nic_model_type = nil if @nic_model_type == UNSET_VALUE
@nested = false if @nested == UNSET_VALUE
diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb
index 53e48b3..51f2ea6 100644
--- a/lib/vagrant-libvirt/templates/domain.xml.erb
+++ b/lib/vagrant-libvirt/templates/domain.xml.erb
@@ -152,6 +152,9 @@