提交 8dc93ffa 编写于 作者: D Daniel P. Berrange

Fix release of resources with lockd plugin

The lockd plugin for the lock manager was not correctly
handling the release of resource locks. This meant that
during migration, or when pausing a VM, the locks would
not get released. This in turn made it impossible to
resume the domain, or finish migration
上级 d6670a64
......@@ -774,10 +774,11 @@ static int virLockManagerLockDaemonRelease(virLockManagerPtr lock,
virNetClientPtr client = NULL;
virNetClientProgramPtr program = NULL;
int counter = 0;
virLockSpaceProtocolReleaseResourceArgs args;
int rv = -1;
size_t i;
virLockManagerLockDaemonPrivatePtr priv = lock->privateData;
memset(&args, 0, sizeof(args));
virCheckFlags(0, -1);
if (state)
*state = NULL;
......@@ -785,16 +786,29 @@ static int virLockManagerLockDaemonRelease(virLockManagerPtr lock,
if (!(client = virLockManagerLockDaemonConnect(lock, &program, &counter)))
goto cleanup;
args.flags = flags;
if (virNetClientProgramCall(program,
client,
counter++,
VIR_LOCK_SPACE_PROTOCOL_PROC_RELEASE_RESOURCE,
0, NULL, NULL, NULL,
(xdrproc_t)xdr_virLockSpaceProtocolReleaseResourceArgs, &args,
(xdrproc_t)xdr_void, NULL) < 0)
goto cleanup;
for (i = 0 ; i < priv->nresources ; i++) {
virLockSpaceProtocolReleaseResourceArgs args;
memset(&args, 0, sizeof(args));
if (priv->resources[i].lockspace)
args.path = priv->resources[i].lockspace;
args.name = priv->resources[i].name;
args.flags = priv->resources[i].flags;
args.flags &=
~(VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED |
VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE);
if (virNetClientProgramCall(program,
client,
counter++,
VIR_LOCK_SPACE_PROTOCOL_PROC_RELEASE_RESOURCE,
0, NULL, NULL, NULL,
(xdrproc_t)xdr_virLockSpaceProtocolReleaseResourceArgs, &args,
(xdrproc_t)xdr_void, NULL) < 0)
goto cleanup;
}
rv = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册