mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-virtio, vhost_user_{fs,block,backend}: Move EVENT_IDX handling
Move the method that is used to decide whether the guest should be signalled into the Queue implementation from vm-virtio. This removes duplicated code between vhost_user_backend and the vm-virtio block implementation. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
8ae7a38da5
commit
a813b57f59
@@ -153,8 +153,9 @@ impl VhostUserBlkThread {
|
||||
}
|
||||
|
||||
if self.event_idx {
|
||||
if let Some(used_idx) = vring.mut_queue().add_used(mem, head.index, len) {
|
||||
if vring.needs_notification(&mem, Wrapping(used_idx)) {
|
||||
let queue = vring.mut_queue();
|
||||
if let Some(used_idx) = queue.add_used(mem, head.index, len) {
|
||||
if queue.needs_notification(&mem, Wrapping(used_idx)) {
|
||||
debug!("signalling queue");
|
||||
vring.signal_used_queue().unwrap();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user