mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-23 06:23:10 +00:00
util: fix index when building lock owners array
The "restart" function for locks allocates a new array according to and pre-sets its length, then reads the owner pids from a JSON document in a loop. Rather than adding each owner at a different index, though, it repeatedly overwrites the last element of the array with all the owners.
This commit is contained in:
parent
3782814d4a
commit
bc4b433098
@ -435,7 +435,7 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
res->owners[res->nOwners-1] = (pid_t)owner;
|
res->owners[j] = (pid_t)owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virHashAddEntry(lockspace->resources, res->name, res) < 0) {
|
if (virHashAddEntry(lockspace->resources, res->name, res) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user