Skip to content

Commit

Permalink
Add VirtIO Viomem Driver support
Browse files Browse the repository at this point in the history
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
  • Loading branch information
kostyanf14 committed Jul 25, 2022
1 parent 85e7662 commit 4e46e9a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
11 changes: 11 additions & 0 deletions drivers.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@
"Hardware-enforced Stack Protection Compatibility Test"
]
},
"viomem": {
"name": "VirtIO Viomem Driver",
"device": "virtio-mem-pci",
"inf": "viomem.inf",
"install_method": "PNP",
"type": 0,
"support": false,
"blacklist": [
"Hardware-enforced Stack Protection Compatibility Test"
]
},
"openvpn": {
"name": "TAP-Windows Adapter V9",
"device": "e1000e",
Expand Down
7 changes: 7 additions & 0 deletions lib/setupmanagers/qemuhck/devices/virtio-mem-pci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "virtio-mem-pci",
"command_line": [
"-object memory-backend-ram,id=mem_backend,size=1G",
"-device virtio-mem-pci@device_extra_param@,memdev=mem_backend,requested-size=300M,bus=@[email protected]"
]
}
13 changes: 12 additions & 1 deletion lib/setupmanagers/qemuhck/qemu_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@ def options_replacement_list
}
end

def double_memory
memory = option_config('memory')
memory2 = (memory.to_i * 2).to_s
if memory.to_i.to_s == memory
memory2
else
memory2 + memory[-1..]
end
end

def full_replacement_list
{
'@run_id@' => @id,
Expand All @@ -201,6 +211,7 @@ def full_replacement_list
'@client_id@' => @client_id,
'@workspace@' => @workspace_path,
'@memory@' => option_config('memory'),
'@double_memory@' => double_memory,
'@cpu_count@' => option_config('cpu_count'),
'@cpu_model@' => option_config('cpu_model'),
'@vnc_id@' => @vnc_id,
Expand Down Expand Up @@ -351,7 +362,7 @@ def process_devices
def base_cmd
[
'@qemu_bin@ -enable-kvm -machine @machine_name@@machine_extra_param@ ',
'-m @memory@ -smp @cpu_count@,cores=@cpu_count@ ',
'-m @memory@,maxmem=@double_memory@ -smp @cpu_count@,cores=@cpu_count@ ',
'-cpu qemu64,+x2apic,+fsgsbase@cpu_options@,model=@cpu_model@ -boot order=cd,menu=on ',
'-nodefaults -no-user-config -usb -device usb-tablet -vnc :@vnc_id@ ',
'-global kvm-pit.lost_tick_policy=discard -rtc base=localtime,clock=host,driftfix=slew ',
Expand Down

0 comments on commit 4e46e9a

Please sign in to comment.