提交 55074071 编写于 作者: J Ján Tomko

Remove storage pool from the arguments of a few functions

virStorageBackendISCSISession only needs the path of the source
device and virStorageBackendISCSIRescanLUNs doesn't need the pool
at all.

This will allow the functions to be moved to src/util.
上级 20534275
......@@ -96,7 +96,7 @@ virStorageBackendISCSIExtractSession(char **const groups,
}
static char *
virStorageBackendISCSISession(virStoragePoolObjPtr pool,
virStorageBackendISCSIGetSession(const char *devpath,
bool probe)
{
/*
......@@ -114,7 +114,7 @@ virStorageBackendISCSISession(virStoragePoolObjPtr pool,
};
struct virStorageBackendISCSISessionData cbdata = {
.session = NULL,
.devpath = pool->def->source.devices[0].path
.devpath = devpath,
};
virCommandPtr cmd = virCommandNewArgList(ISCSIADM, "--mode", "session", NULL);
......@@ -138,6 +138,13 @@ cleanup:
return cbdata.session;
}
static char *
virStorageBackendISCSISession(virStoragePoolObjPtr pool,
bool probe)
{
return virStorageBackendISCSIGetSession(pool->def->source.devices[0].path, probe);
}
#define LINE_SIZE 4096
......@@ -442,8 +449,7 @@ virStorageBackendISCSIFindLUs(virStoragePoolObjPtr pool,
}
static int
virStorageBackendISCSIRescanLUNs(virStoragePoolObjPtr pool ATTRIBUTE_UNUSED,
const char *session)
virStorageBackendISCSIRescanLUNs(const char *session)
{
virCommandPtr cmd = virCommandNewArgList(ISCSIADM,
"--mode", "session",
......@@ -865,7 +871,7 @@ virStorageBackendISCSIRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
if ((session = virStorageBackendISCSISession(pool, false)) == NULL)
goto cleanup;
if (virStorageBackendISCSIRescanLUNs(pool, session) < 0)
if (virStorageBackendISCSIRescanLUNs(session) < 0)
goto cleanup;
if (virStorageBackendISCSIFindLUs(pool, session) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册