From 11f3821777becf14b3bb3c14122f8cb5af55a8c7 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 26 Aug 2024 12:46:59 +0200 Subject: [PATCH] Allow setting cpu mode again The value for `cpu.dig(:model, :name)` is always `nil` since that's the condition in the `if` statement. It was intended to still respect the cpu mode option passed in. Fixes: 7a3a46b48fe7 ("Prefer CPU host pass through over explicit models") --- lib/fog/libvirt/models/compute/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index a0cbafe..531e631 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -307,7 +307,7 @@ def to_xml end else xml.cpu( - :mode => cpu.dig(:model, :name) || "host-passthrough", + :mode => cpu.fetch(:mode, "host-passthrough"), :check => cpu.fetch(:check, "none"), :migratable => cpu.fetch(:migratable, "on") )