Skip to content

Commit c3c2dc0

Browse files
committed
Add switch for enabling qemu guest agent virtio channel
1 parent 548c27e commit c3c2dc0

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ Role Variables
9494
- `enable_spice`: If true enables SPICE listening for use with
9595
Virtual Machine Manager and similar tools
9696

97+
- `enable_guest_virtio`: If true enables guest virtio device for use with
98+
Qemu guest agent
99+
97100
- `volumes`: a list of volumes to attach to the VM. Each volume is
98101
defined with the following dict:
99102
- `type`: What type of backing volume does the instance use? All

tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
autostart: "{{ vm.autostart | default(true) }}"
4747
enable_vnc: "{{ vm.enable_vnc | default(false) }}"
4848
enable_spice: "{{ vm.enable_spice | default(false) }}"
49+
enable_guest_virtio: "{{ vm.enable_guest_virtio | default(false) }}"
4950
boot_firmware: "{{ vm.boot_firmware | default('bios', true) | lower }}"
5051
with_items: "{{ libvirt_vms }}"
5152
loop_control:

templates/vm.xml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@
124124
<listen type='address'/>
125125
</graphics>
126126
{% endif %}
127+
{% if enable_guest_virtio |bool %}
128+
<channel type='unix'>
129+
<target type='virtio' name='org.qemu.guest_agent.0'/>
130+
</channel>
131+
{% endif %}
127132
{% for usb_device in usb_devices %}
128133
<hostdev mode='subsystem' type='usb' managed='yes'>
129134
<source>

0 commit comments

Comments
 (0)