瀏覽代碼

Don't try to unset queues on PCI transport.

Setting the queue_size to 0 is not allowed by the spec, so it doesn't
make much sense to set the other pointers to 0 either.
Andrew Walbran 2 年之前
父節點
當前提交
45e91c84c6
共有 1 個文件被更改,包括 3 次插入10 次删除
  1. 3 10
      src/transport/pci.rs

+ 3 - 10
src/transport/pci.rs

@@ -294,16 +294,9 @@ impl Transport for PciTransport {
         }
     }
 
-    fn queue_unset(&mut self, queue: u16) {
-        // Safe because the common config pointer is valid and we checked in get_bar_region that it
-        // was aligned.
-        unsafe {
-            volwrite!(self.common_cfg, queue_select, queue);
-            volwrite!(self.common_cfg, queue_size, 0);
-            volwrite!(self.common_cfg, queue_desc, 0);
-            volwrite!(self.common_cfg, queue_driver, 0);
-            volwrite!(self.common_cfg, queue_device, 0);
-        }
+    fn queue_unset(&mut self, _queue: u16) {
+        // The VirtIO spec doesn't allow queues to be unset once they have been set up for the PCI
+        // transport, so this is a no-op.
     }
 
     fn queue_used(&mut self, queue: u16) -> bool {