vmm: Make add_vfio_device mutable

The method add_vfio_device() from the DeviceManager needs to be mutable
if we want later to be able to update some internal fields from the
DeviceManager from this same function.

This commit simply takes care of making the necessary changes to change
this function as mutable.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-03-04 15:54:42 +01:00
parent 948f808da6
commit d0820cc026
2 changed files with 25 additions and 8 deletions
+14 -2
View File
@@ -621,7 +621,13 @@ impl Vm {
.start_boot_vcpus(entry_addr)
.map_err(Error::CpuManager)?;
if self.device_manager.lock().unwrap().console().input_enabled() {
if self
.device_manager
.lock()
.unwrap()
.console()
.input_enabled()
{
let console = self.device_manager.lock().unwrap().console().clone();
let signals = Signals::new(&[SIGWINCH, SIGINT, SIGTERM]);
match signals {
@@ -660,7 +666,13 @@ impl Vm {
.read_raw(&mut out)
.map_err(Error::Console)?;
if self.device_manager.lock().unwrap().console().input_enabled() {
if self
.device_manager
.lock()
.unwrap()
.console()
.input_enabled()
{
self.device_manager
.lock()
.unwrap()