代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libiscsi 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 2ae45ac15d8c1d4a4f68a085dadb7f43e2f2e280 Mon Sep 17 00:00:00 2001
From: David Disseldorp <ddiss@suse.de>
Date: Mon, 16 Sep 2019 14:46:28 +0200
Subject: [PATCH 11/12] test-tool/OverwriteReserved: override driver
queue_pdu() callback
In preparation for removing the test-tool iscsi_queue_pdu() dlsym
overload hack, convert this test to use the regular transport driver
callback for this purpose.
Signed-off-by: David Disseldorp <ddiss@suse.de>
---
test-tool/test_sanitize_overwrite_reserved.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/test-tool/test_sanitize_overwrite_reserved.c b/test-tool/test_sanitize_overwrite_reserved.c
index 79f8a92..91090b4 100644
--- a/test-tool/test_sanitize_overwrite_reserved.c
+++ b/test-tool/test_sanitize_overwrite_reserved.c
@@ -26,8 +26,9 @@
#include "iscsi-test-cu.h"
static int change_num;
+static struct iscsi_transport iscsi_drv_orig;
-static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu *pdu)
+static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
{
switch (change_num) {
case 1:
@@ -44,12 +45,12 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi _U_, struct iscsi_pdu
break;
}
- change_num = 0;
- return 0;
+ change_num = 0;
+ return iscsi_drv_orig.queue_pdu(iscsi, pdu);
}
void test_sanitize_overwrite_reserved(void)
-{
+{
int i;
struct iscsi_data data;
@@ -75,7 +76,9 @@ void test_sanitize_overwrite_reserved(void)
return;
}
- local_iscsi_queue_pdu = my_iscsi_queue_pdu;
+ /* override transport queue_pdu callback for PDU manipulation */
+ iscsi_drv_orig = *sd->iscsi_ctx->drv;
+ sd->iscsi_ctx->drv->queue_pdu = my_iscsi_queue_pdu;
logging(LOG_VERBOSE, "Send SANITIZE command with the reserved "
"bit in byte 1 set to 1");
@@ -91,4 +94,7 @@ void test_sanitize_overwrite_reserved(void)
SANITIZE(sd, 0, 0, SCSI_SANITIZE_OVERWRITE, data.size, &data,
EXPECT_INVALID_FIELD_IN_CDB);
}
+
+ /* restore transport callbacks */
+ *(sd->iscsi_ctx->drv) = iscsi_drv_orig;
}
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。