提交 cd355a52 编写于 作者: M Michal Privoznik

security_stack: Turn list of nested drivers into a doubly linked list

In near future we will need to walk through the list of internal
drivers in reversed order. The simplest solution is to turn
singly linked list into a doubly linked list.
We will not need to start from the end really, so there's no tail
pointer kept.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 3f968a87
......@@ -35,6 +35,7 @@ typedef virSecurityStackItem *virSecurityStackItemPtr;
struct _virSecurityStackItem {
virSecurityManagerPtr securityManager;
virSecurityStackItemPtr next;
virSecurityStackItemPtr prev;
};
struct _virSecurityStackData {
......@@ -56,6 +57,7 @@ virSecurityStackAddNested(virSecurityManagerPtr mgr,
if (VIR_ALLOC(item) < 0)
return -1;
item->securityManager = nested;
item->prev = tmp;
if (tmp)
tmp->next = item;
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册