mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
add support for boot 'network' from a vagrant public_network
when use a public_network in vagrant, this is how libvirt domain xml looks like (notice that the interface type is 'direct'):
<interface type="direct">
<mac address="08:00:27:00:00:01"/>
<source dev="br-rpi" mode="bridge"/>
<model type="virtio"/>
<boot order="2"/> <!-- this boot xml node will be inserted with this commit -->
<address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0"/>
</interface>
This commit is contained in:
@@ -86,9 +86,13 @@ module VagrantPlugins
|
||||
|
||||
def search_network(nets, xml)
|
||||
str = '/domain/devices/interface'
|
||||
str += "[(@type='network' or @type='udp' or @type='bridge')"
|
||||
str += "[(@type='network' or @type='udp' or @type='bridge' or @type='direct')"
|
||||
unless nets.empty?
|
||||
str += " and source[@network='#{nets.first['network']}']"
|
||||
net = nets.first
|
||||
network = net['network']
|
||||
dev = net['dev']
|
||||
str += " and source[@network='#{network}']" if network
|
||||
str += " and source[@dev='#{dev}']" if dev
|
||||
end
|
||||
str += ']'
|
||||
@logger.debug(str)
|
||||
|
||||
Reference in New Issue
Block a user