vm-virtio: vhost-user: Send memory update to the backend

In order to keep vhost-user backend to work across guest memory resizing
happening when memory is hot-plugged or hot-unplugged, both blk, net and
fs devices are implementing the notifier to let the backend know.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-03-23 13:47:55 +01:00
committed by Rob Bradford
parent 7ff82af4b2
commit d75e7456fc
3 changed files with 13 additions and 1 deletions

View File

@@ -358,6 +358,10 @@ impl VirtioDevice for Net {
fn shutdown(&mut self) {
let _ = unsafe { libc::close(self.vhost_user_net.as_raw_fd()) };
}
fn update_memory(&mut self, mem: &GuestMemoryMmap) -> std::result::Result<(), crate::Error> {
update_mem_table(&mut self.vhost_user_net, mem).map_err(crate::Error::VhostUserUpdateMemory)
}
}
virtio_ctrl_q_pausable!(Net);