1 Star 0 Fork 23

ganqx/src-stratovirt

forked from src-openEuler/stratovirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vsock-diable-VIRTIO_F_ACCESS_PLATFORM-feature.patch 1.54 KB
一键复制 编辑 原始数据 按行查看 历史
From 7e8d64b3c21f606dd0b030f324b098444d489bc3 Mon Sep 17 00:00:00 2001
From: Yan Wang <wangyan122@huawei.com>
Date: Fri, 1 Sep 2023 17:19:26 +0800
Subject: [PATCH] vsock: diable VIRTIO_F_ACCESS_PLATFORM feature
Currently, we don't support VIRTIO_F_ACCESS_PLATFORM feature.
So, disable it.
Signed-off-by: Yan Wang <wangyan122@huawei.com>
---
virtio/src/vhost/kernel/vsock.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/virtio/src/vhost/kernel/vsock.rs b/virtio/src/vhost/kernel/vsock.rs
index 17bc342..2b05fd0 100644
--- a/virtio/src/vhost/kernel/vsock.rs
+++ b/virtio/src/vhost/kernel/vsock.rs
@@ -30,7 +30,8 @@ use crate::VirtioError;
use anyhow::{anyhow, bail, Context, Result};
use super::super::super::{
- Queue, VirtioDevice, VirtioInterrupt, VirtioInterruptType, VIRTIO_TYPE_VSOCK,
+ Queue, VirtioDevice, VirtioInterrupt, VirtioInterruptType, VIRTIO_F_ACCESS_PLATFORM,
+ VIRTIO_TYPE_VSOCK,
};
use super::super::{VhostNotify, VhostOps};
use super::{VhostBackend, VhostIoHandler, VHOST_VSOCK_SET_GUEST_CID, VHOST_VSOCK_SET_RUNNING};
@@ -174,9 +175,10 @@ impl VirtioDevice for Vsock {
backend
.set_owner()
.with_context(|| "Failed to set owner for vsock")?;
- self.state.device_features = backend
+ let features = backend
.get_features()
.with_context(|| "Failed to get features for vsock")?;
+ self.state.device_features = features & !(1_u64 << VIRTIO_F_ACCESS_PLATFORM);
self.backend = Some(backend);
Ok(())
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ganqx/src-stratovirt.git
git@gitee.com:ganqx/src-stratovirt.git
ganqx
src-stratovirt
src-stratovirt
master

搜索帮助