代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8c65e8d7c923ade6f3c7fbef43000562d4733629 Mon Sep 17 00:00:00 2001
From: fangyi <eric.fangyi@huawei.com>
Date: Sat, 7 Sep 2024 07:11:07 +0000
Subject: [PATCH 2/6] vdpa: support resizing virtio-blk capacity online for
kernel vdpa
Signed-off-by: fangyi <eric.fangyi@huawei.com>
---
hw/virtio/vdpa-dev.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c
index 91e71847b0..bf4b3ec3fd 100644
--- a/hw/virtio/vdpa-dev.c
+++ b/hw/virtio/vdpa-dev.c
@@ -31,6 +31,7 @@
#include "hw/virtio/vdpa-dev-mig.h"
#include "migration/migration.h"
#include "exec/address-spaces.h"
+#include "standard-headers/linux/virtio_ids.h"
static void
vhost_vdpa_device_dummy_handle_output(VirtIODevice *vdev, VirtQueue *vq)
@@ -201,7 +202,23 @@ static void
vhost_vdpa_device_get_config(VirtIODevice *vdev, uint8_t *config)
{
VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
+ uint8_t *new_config;
+ int ret;
+
+ if (s->vdev_id != VIRTIO_ID_BLOCK) {
+ goto out;
+ }
+ new_config = g_malloc0(s->config_size);
+ ret = vhost_dev_get_config(&s->dev, new_config, s->config_size, NULL);
+ if (ret < 0) {
+ error_report("vhost-vdpa-device: get config failed(%d)\n", ret);
+ goto free;
+ }
+ memcpy(s->config, new_config, s->config_size);
+free:
+ g_free(new_config);
+out:
memcpy(config, s->config, s->config_size);
}
--
2.43.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。