Skip to content

Commit

Permalink
Prefer CPU host pass through over explicit models
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Oct 19, 2023
1 parent 283dc9f commit 7a3a46b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/fog/libvirt/models/compute/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,16 @@ def to_xml
end

unless cpu.empty?
if cpu[:mode]
xml.cpu(:mode => cpu[:mode])
else
if cpu.dig(:model, :name)
xml.cpu do
xml.model(cpu.dig(:model, :name), :fallback => cpu.dig(:model, :fallback) || "allow")
end
else
xml.cpu(
:mode => cpu.dig(:model, :name) || "host-passthrough",
:check => cpu.fetch(:check, "none"),
:migratable => cpu.fetch(:migratable, "on")
)
end
end

Expand Down

0 comments on commit 7a3a46b

Please sign in to comment.