We want to test power management in our functional tests in multinode
scenarios (ex: live migration).
This was previously impossible because all the methods in
nova.virt.libvirt.cpu.api and were at the module level, meaning both
source and destination libvirt drivers would call the same method to
online and offline cores. This made it impossible to maintain distinct
core power state between source and destination.
This patch inserts a nova.virt.libvirt.cpu.api.API class, and gives
the libvirt driver a cpu_api attribute with an instance of that
class. Along with the tiny API.core() helper, this allows new
functional tests in the subsequent patches to stub out the core
"model" code with distinct objects on the source and destination
libvirt drivers, and enables a whole bunch of testing (and fixes!)
around live migration.
Related-bug: 2056613
Change-Id: I052535249b9a3e144bb68b8c588b5995eb345b97
(cherry picked from commit 29dc044a7aa1b1dd35ea4695c055feb5136ba1e5)
(cherry picked from commit 2a0e63828b6fefc1e83349f0bdac7f9eb8ea6678)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /913225 /opendev. org/openstack/ nova/commit/ 874acc1ed16d312 5db16add1e03dea 65d8c542ca
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/2023.1
commit 874acc1ed16d312 5db16add1e03dea 65d8c542ca
Author: Artom Lifshitz <email address hidden>
Date: Fri Mar 8 13:00:30 2024 -0500
pwr mgmt: make API into a per-driver object
We want to test power management in our functional tests in multinode
scenarios (ex: live migration).
This was previously impossible because all the methods in virt.libvirt. cpu.api and were at the module level, meaning both
nova.
source and destination libvirt drivers would call the same method to
online and offline cores. This made it impossible to maintain distinct
core power state between source and destination.
This patch inserts a nova.virt. libvirt. cpu.api. API class, and gives
the libvirt driver a cpu_api attribute with an instance of that
class. Along with the tiny API.core() helper, this allows new
functional tests in the subsequent patches to stub out the core
"model" code with distinct objects on the source and destination
libvirt drivers, and enables a whole bunch of testing (and fixes!)
around live migration.
Related-bug: 2056613 144bb68b8c588b5 995eb345b97 d35ea4695c055fe b5136ba1e5) 1e83349f0bdac7f 9eb8ea6678)
Change-Id: I052535249b9a3e
(cherry picked from commit 29dc044a7aa1b1d
(cherry picked from commit 2a0e63828b6fefc